Skip to content

Instantly share code, notes, and snippets.

@waynedovey
Last active May 13, 2020 04:49
Show Gist options
  • Save waynedovey/37b9a897c83ddd4e178fc1b5f815ea1c to your computer and use it in GitHub Desktop.
Save waynedovey/37b9a897c83ddd4e178fc1b5f815ea1c to your computer and use it in GitHub Desktop.
Clean out the Git History if you have checked in a password by mistake
# Feature Branch
git checkout --orphan fixit
git add -A
git commit -m "update"
git branch -D feature/bastion-create
git branch -m feature/bastion-create
git push -f origin feature/bastion-create
git gc --aggressive --prune=all
# Master Branch
git checkout --orphan fixit
git add -A
git commit -m "update"
git branch -D master
git branch -m master
git push -f origin master
git gc --aggressive --prune=all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment