Created
September 2, 2017 13:40
-
-
Save ckunte/1a2b8d7d225782f800701fd7b1fe8403 to your computer and use it in GitHub Desktop.
Delete and recreate master
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
git checkout --orphan newBranch | |
git add -A | |
git commit -m 'first commit' | |
# Deletes the master branch | |
git branch -D master | |
# Rename the current branch to master | |
git branch -m master | |
# Force push master branch to github | |
git push -f origin master | |
# Remove old files | |
git gc --aggressive --prune=all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment