Skip to content

Instantly share code, notes, and snippets.

@ankitagarwal
Created August 19, 2014 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitagarwal/8c0f03d1683ea7e0b4f2 to your computer and use it in GitHub Desktop.
Save ankitagarwal/8c0f03d1683ea7e0b4f2 to your computer and use it in GitHub Desktop.
Subtree merge with history rewrite
git filter-branch --index-filter \
'git ls-files -s | sed "s-\t\"*-&grade\/report\/history/-" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
git update-index --index-info &&
mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"
' HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment