Skip to content

Instantly share code, notes, and snippets.

@MickTK
Last active November 23, 2022 11:02
Show Gist options
  • Save MickTK/b09650b456b1a77fba982ad2c8bf0b69 to your computer and use it in GitHub Desktop.
Save MickTK/b09650b456b1a77fba982ad2c8bf0b69 to your computer and use it in GitHub Desktop.
Delete the repository commits history preserving all the content.
# Execute in the repository folder
git checkout --orphan latest_branch
git add -A
git commit -am "-"
git branch -D main
git branch -m main
git push -f origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment