Skip to content

Instantly share code, notes, and snippets.

@andrzejkaszkowiak
Created July 1, 2020 10:59
Show Gist options
  • Save andrzejkaszkowiak/eb40f135a76fb37f0dae3dea93a28639 to your computer and use it in GitHub Desktop.
Save andrzejkaszkowiak/eb40f135a76fb37f0dae3dea93a28639 to your computer and use it in GitHub Desktop.
#!/bin/bash
# https://www.hanselman.com/blog/EasilyRenameYourGitDefaultBranchFromMasterToMain.aspx
# git branch -m master main
# git push -u origin main
git checkout master
git branch -m master main
git fetch
git branch --unset-upstream
git branch -u origin/main
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment