Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIEW: Add Warning Or Disclaimer For Having Git Init Default Head Branch Set To Master Instead Of Main #58

Open
Spectralgo opened this issue Jul 21, 2022 · 3 comments

Comments

@Spectralgo
Copy link

On the first automated commit, if the default branch name in standardly code generator is "main" and the local git init default is set to "master", there are nasty, dirty pushes to github.

@Spectralgo Spectralgo changed the title VIEW: Add Warning Or Disclaimer For Having Git Init Default Head Branch Set To Master Instead Of Main VIEW: Add Warning Or Disclaimer For Having Git Init Default Head Branch Set To Main Instead Of Master Jul 21, 2022
@Spectralgo Spectralgo changed the title VIEW: Add Warning Or Disclaimer For Having Git Init Default Head Branch Set To Main Instead Of Master VIEW: Add Warning Or Disclaimer For Having Git Init Default Head Branch Set To Master Instead Of Main Jul 21, 2022
@cjdutoit
Copy link
Owner

@Spectralgo @coeur85 GitHub CLI does not currently offer a command to check the default branch name so it would not be possible to do that check at the moment to do this validation.

GitHub uses main by default. If you are creating your repo via Visual Studio and this is setting up the branch as master then you could run this command to ensure Visual Studio uses main next time.

git config --global init.defaultBranch main

@coeur85
Copy link
Contributor

coeur85 commented Jul 24, 2022

i able to retrieve the default branch with this command with git hub cli
gh repo view --json defaultBranchRef

does that help ?

Screen Shot 2022-07-24 at 2 23 28 PM

@cjdutoit cjdutoit reopened this Sep 4, 2022
@cjdutoit
Copy link
Owner

cjdutoit commented Sep 4, 2022

Thanks @coeur85, I will have another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants