Created
May 29, 2013 10:41
-
-
Save mohanarpit/5669427 to your computer and use it in GitHub Desktop.
This script takes the SHA1-ID of the commit as the input and truncates the history of the repository for all commits beyond that SHA1-ID
This file contains 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
#!/bin/bash | |
# This script takes the SHA-I1D of the commit as the input and truncates the history of the repository for all commits beyond # that SHA1-ID | |
git checkout --orphan tmp $1 | |
git commit -m "Truncated history" | |
git rebase --onto tmp $1 master | |
git branch -D tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment