Make an alias for existing branch

Cover image

Make an alias for existing branch

Photo by Mohammad Rahmani on Unsplash

If you happened to miss the master branch and your organization uses the more populistic main naming convention as the default branch, don’t worry! You can easily switch back to the previous environment without causing any issues using a simple Git alias command.:

$ git symbolic-ref refs/heads/master refs/heads/main

This tool won’t replace everything, but it can help you use old commands like:

$ git checkout master

$ git rebase -i master

$ git diff master