Skip to content

Instantly share code, notes, and snippets.

@fetis
Last active October 21, 2020 12:12
Show Gist options
  • Save fetis/f0fa9ef3ebc972c3809f21ab9a4fda36 to your computer and use it in GitHub Desktop.
Save fetis/f0fa9ef3ebc972c3809f21ab9a4fda36 to your computer and use it in GitHub Desktop.
How to restore `master` branch

How to restore master branch

Once you've created your new repo you might be interested to bring master branch back to be aligned with your other projects

Here'are the steps how to do it:

  1. Brings master back
git checkout -b master && git push origin -u master
  1. Go to Github UI repo under Settings/Branches and switch to the new default

  2. Delete the main branch now

git branch -d main && git push -d origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment