Skip to content

Instantly share code, notes, and snippets.

@Datseris
Last active June 29, 2026 14:15
Show Gist options
  • Select an option

  • Save Datseris/d23a46333d20aada2b3ae63f97437d47 to your computer and use it in GitHub Desktop.

Select an option

Save Datseris/d23a46333d20aada2b3ae63f97437d47 to your computer and use it in GitHub Desktop.
Delete git history and replace branch with one without history
git checkout --orphan new-branch
git add -A
git commit -m "Initial commit with no history"
git branch -D main
git branch -m main
@Datseris

Copy link
Copy Markdown
Author

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