git-school / visualizing-git

:framed_picture: Visualize how common Git operations affect the commit graph

Home Page:http://git-school.github.io/visualizing-git/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use 'main' instead of 'master' as the default branch

gusshawstewart opened this issue · comments

commented

Would it be possible to change the default branch name to main from master? There is a movement towards this revised naming of the default branch within the community, and I think it would be great to keep this fantastic tool up to date. :)

In case anyone else needs a temporary workaround for a demo: Execute the following commands one by one (and ignore that they're different from what you would do in an actual git repository):

git checkout -b main
git branch -d master

Plus, if you have a remote:

git branch -m origin/master origin/main
git branch -d origin/master
mode remote
git checkout -b main
git branch -d master
mode local

Now all that's left to do is hide our hacky attempt to fix the original state. Fortunately, the command list is easy to find in the dev tools:

image

Issue is fixed in my fork and you can use it here.

Tagging @kuychaco , @gusshawstewart , can we get this fixed please? This feels really antiquated, now that the default is Main on most SCM systems.