loading...

re: Replacing master in git VIEW POST

FULL DISCUSSION
 

The Git Development Community is working to at least make the name of the main branch easily configurable, so in not so far future having "main" or "trunk" branch instead of current default of "master" from git-init / git-clone would be much easier.

 

The Git Development Community is working to at least make the name of the main branch easily configurable

What's wrong with it now?

mkdir /tmp/git-init && cd $_
git init && git checkout -b main
git commit -m init --allow-empty
git branch -a
git log --oneline
 

As far as I remember, changing the default branch would be able to be done with command line parameter or a configuration variable

git init --default-branch=main

or

git config branch.default main
# ...
git init
 

Please tell me you're being facetious...

Why would I be? It's as easy as specifying the branch name in your checkout command to change what your default is.

Because you asked what was wrong with a 7-step init process, in response to someone mentioning that the git developers are working on making it a configuration option.

It's not a seven-step process, though, that was just a complete example for illustration. It's as simple as:

git init
git checkout -b main
 

Flexibility like this is critical for the health of software development in general. IMO this is a good stress test on software maintainability in general.

Some comments have been hidden by the post's author - find out more

code of conduct - report abuse