Git initial-branch option ignored #23592
-
For context, I’m still trying to get things setup for git and github to work together well, and I’m getting pretty close. The problem I’m currently facing is that git uses the master branch, but github uses the main branch. I read a long article about why exactly that is, which was nice, but the recommendation to fix it didn’t help. The artcle recommended However, that returns: I searched for this error online but I didn’t find anything helpful for me. Any ideas on how to get git to stop ignoring me? Bad git! :slight_smile: Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
In your existing repository you can just rename the branch:
For a new repository that init command should work, or you could set the |
Beta Was this translation helpful? Give feedback.
-
While I disagree that ignoring user input, especially without explaining why, is a good thing, I appreciate the information. |
Beta Was this translation helpful? Give feedback.
-
FizzleFuze:
It told you why, though admittedly not very verbosely. 😉 |
Beta Was this translation helpful? Give feedback.
-
works like a charm thanks! |
Beta Was this translation helpful? Give feedback.
git init
won’t delete existing branches if you call it again in an existing repository, that’s a good thing. In general, there’s no reason to callgit init
in an existing repository. 😉In your existing repository you can just rename the branch:
For a new repository that init command should work, or you could set the
init.defaultBranch
option to change whatgit init
does without the parameter.