-
Notifications
You must be signed in to change notification settings - Fork 91
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
Have initialize_project() initialize the git repo with a main
branch instead of master
.
#251
Comments
Why should the default branch be named |
It's a DEI update. GitHub has already implemented a switch to default a new repo's primary branch as For context, see this article. And from the git docs for
|
ok, this sounds like a trivial "fix" then. |
main
branch instead of master
.
I just tried to solve this, and it is hard. Because we need to do it through the |
Seems like using Git.jl is the only way. We also can do the simple:
With the |
Yes, tried making a new project with DW after changing the global git config default branch and main popped right out. Thanks! |
I set it to closed because I realized it might not be good to change a user's global git config settings while setting up a DrWatson project:
I could imagine someone having templates for such helper utilities that they apply to new repos, and messing with their git config might interupt something? And maybe just having the option to change the default branch name through this config is enough. |
That sounds valid. However, the reason I re-opened this is because the issue request still stands. DrWatson should try to initialize a repo with |
I just checked if this was still an issue (before trying my hands on fixing it). I could not find the commit (if any) that fixed this, but it seems to me that this issue is no longer a problem. |
I have fixed it, but DrWatson constantly throws a warning that "the defualt branch could not be renamed to "main"". So I don't know why it throws the warning, even though it does succeed in the rename. Here is the code that triggers the warning: https://github.com/JuliaDynamics/DrWatson.jl/blob/main/src/project_setup.jl#L311 |
Have
initialize_project()
initialize the git repo with a main branch instead of master.The git command is simply
git branch -m master main
.Still learning Julia, so I'm not quite sure how to make a PR with an edit to the source.
While it's true a user can configure their git to default to main with
git config --global init.defaultBranch main
, this would be a beneficial change for DrWatson to have by default until the baked in default for git is main.The text was updated successfully, but these errors were encountered: