Skip to content

Instantly share code, notes, and snippets.

@yonixw
Created April 9, 2019 21:01
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 yonixw/2ec7138ba04123784ef03f18ce78065f to your computer and use it in GitHub Desktop.
Save yonixw/2ec7138ba04123784ef03f18ce78065f to your computer and use it in GitHub Desktop.
Merging git repos into same repo and saving histories
git filter-branch -f --tree-filter "mkdir Citadel.Core.Windows && ls | grep -v Citadel.Core | xargs -d '\n' mv -t Citadel.Core.Windows" HEAD
git filter-branch -f --tree-filter "if [ -f '.gitignore' ]; then mv '.gitignore' 'Citadel.Core.Windows/.gitignore'; fi" HEAD
git filter-branch -f --tree-filter "if [ -f '.travis.yml' ]; then mv '.travis.yml' 'Citadel.Core.Windows/.travis.yml'; fi" HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment