Skip to content

Instantly share code, notes, and snippets.

@yuriburger
Last active April 30, 2022 21:47
Show Gist options
  • Save yuriburger/345c24154d50a37604b6d2a44d12eef7 to your computer and use it in GitHub Desktop.
Save yuriburger/345c24154d50a37604b6d2a44d12eef7 to your computer and use it in GitHub Desktop.
[git clear commit history] Git clear commit history #git
git checkout --orphan FixHistory
git add -A # Add all files and commit them
git commit -m "Fix history"
git branch -D develop # Deletes the master branch
git branch -m develop # Rename the current branch to master
git push -f origin develop # Force push master branch to github
git gc --aggressive --prune=all # remove the old files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment