Last Updated: February 25, 2016·
Set the default branch in a Git repository
If you're not using master as your main branch, it's useful to create an affordance for your repository users by setting the default branch to your main branch.
You do this by creating a symbolic reference to the branch head in .git/HEAD. Running
git symbolic-ref HEAD refs/heads/main_branch will do the trick.
$ cat .git/HEAD ref: refs/heads/main_branch
Written by Damon Davison
A better git log
Please, oh please, use git pull --rebase
git commit --allow-empty
Have a fresh tip? Share with Coderwall community!
Post a tip
Best #Git Authors
Sponsored by #native_company# — Learn More