Created
February 5, 2012 18:29
-
-
Save manuelmorales/1747053 to your computer and use it in GitHub Desktop.
Remove commits from Git 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
export BRANCH=edge | |
export FIRST="hash_of_the_commit_from_which_to_start_forgetting" | |
export SECOND="hash_of_the_commit_from_which_to_keep_commits" | |
git checkout $BRANCH | |
git checkout $SECOND | |
git reset --soft $FIRST | |
git commit -C $SECOND | |
git rebase --onto HEAD $SECOND $BRANCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment