Created
February 18, 2026 13:17
-
-
Save Datseris/d23a46333d20aada2b3ae63f97437d47 to your computer and use it in GitHub Desktop.
Delete git history and replace branch with one without history
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git checkout --orphan new-branch | |
| git add -A | |
| git commit -m "Initial commit with no history" | |
| git branch -D master | |
| git branch -m master |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From https://gitscripts.com/git-remove-history