Last active
March 6, 2016 11:08
-
-
Save xu-cheng/a7f788d28ea27c2722ff to your computer and use it in GitHub Desktop.
Homebrew Rewrite 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
## extract Formula | |
git filter-branch -f --prune-empty \ | |
--subdirectory-filter 'Library' \ | |
-- --all | |
git filter-branch -f --prune-empty \ | |
--index-filter \ | |
'git rm --cached --ignore-unmatch -r -q -- . ; git reset -q $GIT_COMMIT -- Formula Aliases;' \ | |
-- --al | |
## extract core | |
git filter-branch -f --prune-empty \ | |
--index-filter \ | |
'git rm --cached --ignore-unmatch -r -q -- Library/Formula Library/Aliases ;' \ | |
-- --all | |
## rewrite commit history | |
git filter-branch -f \ | |
--msg-filter 'sed -E -e "s/ (#[0-9]+)/ Homebrew\/homebrew\1/g"' \ | |
-- --all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment