Skip to content

Instantly share code, notes, and snippets.

@kagarlickij
Created November 18, 2021 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kagarlickij/1343a4e2d02c0fadf1d87153cb2831d2 to your computer and use it in GitHub Desktop.
Save kagarlickij/1343a4e2d02c0fadf1d87153cb2831d2 to your computer and use it in GitHub Desktop.
Clean history of Git branch

git checkout --orphan TEMP_BRANCH
git add -A
git commit -am "cleanup"
git branch -D master
git branch -m master
git push -f origin master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment