-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 git branch name to Main instead of Master #8926
Comments
Could be a duplicate of cargo init and use HEAD instead Also I found out that using a git-template could fix this for me if we decides to keep it as is |
I think a reason for keeping |
You need to just configure your git, I have /tmp/tmp.qSrokxe56d > cargo new foo
Created binary (application) `foo` package
/tmp/tmp.qSrokxe56d > cd foo
/tmp/tmp.qSrokxe56d/foo on prīmum > |
Yes it makes sense. I guess you could look at changing to main to be a custom config on these websites part. So staying with git standard makes sense to me. Also I found the git-template solution. I think that is a valid solution for people who want main as default.
This is a good solution for me. Thanks. I'm guessing this is a global gitconfig right? So it would change all my future git inits. |
Closing issue. |
To give a one-liner that accomplishes this, run the following in a terminal:
|
I ran |
I can't reproduce locally on macOS, without configuration both @indianakernick What do One thing I notice is that cargo uses |
I'm also on macOS but I'm using the version of
|
Maybe the config is set in a different config file that |
I get |
When running
The generated project initiates git with default branch name master.
My suggestion is that when running the new project command the default branch name should be main
I know it's not a universal agreement that git branches using main as default now a days, but it is has been growing. Also GitHub that this project is hosted on has decided on main.
Debugging steps:
The text was updated successfully, but these errors were encountered: