Skip to content

Instantly share code, notes, and snippets.

@serrasqueiro
Created August 25, 2024 13:39
Show Gist options
  • Save serrasqueiro/38e57e9fa01696312eec3f8567f597f8 to your computer and use it in GitHub Desktop.
Save serrasqueiro/38e57e9fa01696312eec3f8567f597f8 to your computer and use it in GitHub Desktop.
How to kill the master branch in git
# replacing the master branch name in remote server
henrique@ludo:~/public> git push origin main:master -f
# then in a clean repo:
git push origin --delete master
At server, at "bare" repo (created formerly with 'git init --bare'):
- do `git branch` and see where '*' (star) is.
- the HEAD then should refer to "ref: refs/heads/main",
- instead of ref: refs/heads/master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment