Created
July 4, 2020 16:53
-
-
Save albertodebortoli/d4a254bfe959975ae95266b799c8bb7d to your computer and use it in GitHub Desktop.
Revisions
-
albertodebortoli created this gist
Jul 4, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ https://stackoverflow.com/questions/41953300/how-to-delete-the-old-git-history git checkout --orphan temp <f> # checkout to the status of the git repo at commit f; creating a branch named "temp" git commit -m "new root commit" # create a new commit that is to be the new root commit git rebase --onto temp <f> master # now rebase the part of history from <f> to master onthe temp branch git branch -D temp # we don't need the temp branch anymore