Skip to content

Instantly share code, notes, and snippets.

@sirrapa
Created March 18, 2020 14:30
Show Gist options
  • Save sirrapa/5d1617f08c01e950f3d462fb4ec9118a to your computer and use it in GitHub Desktop.
Save sirrapa/5d1617f08c01e950f3d462fb4ec9118a to your computer and use it in GitHub Desktop.
#!/bin/bash
## Checkout
git checkout --orphan latest_branch
## Add all the files
git add -A
## Commit the changes
git commit -am "Initial"
## Delete the branch
git branch -D master
## Rename the current branch to master
git branch -m master
## Finally, force update your repository
git push -f origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment