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

Change default initial branch to match github #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davisagli
Copy link
Member

@davisagli davisagli commented Feb 3, 2025

Fixes #59

Tested on my machine with and without init.defaultBranch set in ~/.gitconfig

Copy link

@rohnsha0 rohnsha0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for me it still follows the ~/.gitconfig's defaultBranch

@davisagli
Copy link
Member Author

@rohnsha0 Yes, that is my goal: use init.defaultBranch from ~/.gitconfig if it is set (because that is the user's explicit preference). But if it isn't specified there, then use main instead of master.

@rohnsha0
Copy link

rohnsha0 commented Feb 3, 2025

@rohnsha0 Yes, that is my goal: use init.defaultBranch from ~/.gitconfig if it is set (because that is the user's explicit preference). But if it isn't specified there, then use main instead of master.

ummm, to my surprise. When I removed the init.defaultBranch it was still using the master branch... But looking it it again and wait for others to response!

@@ -0,0 +1,2 @@
Use `main` as the default branch for new git repositories, unless it has been
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main is more of a fallback than a default now.

Suggested change
Use `main` as the default branch for new git repositories, unless it has been
Use the `init.defaultBranch` setting in git `config` if available, else `main`, as the branch name for new git repositories. @davisagli

@stevepiercy
Copy link
Contributor

I have no idea how to run a local checkout of this branch to verify it works. It's not covered in the README, and I lack familiarity with the tooling. @davisagli can you clue me in?

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

Successfully merging this pull request may close these issues.

Use main as default branch instead of master branch to be in sync with github
3 participants