I have the following single repository with this structure:
my-repo/ foo/ contents-of-foo bar/ contents-of-bar baz/ contents-of-baz other-contents I wish to get the following structure, ideally without losing any history / tags:
new-combined-repo/ contents-of-foo bar/ contents-of-bar baz/ contents-of-baz and
my-other-repo other-contents I'm a little stuck on how to proceed. I've tried this:
$ pushd path/to/my-repo/ $ git mv bar foo/ $ git mv baz foo/ $ git commit -m "Move bar and baz prior to repository extraction" $ cd .. $ git clone --no-hardlinks my-repo new-combined-repo $ pushd new-combined-repo $ git remote rm origin $ git filter-branch --tag-name-filter cat --subdirectory-filter foo \ --prune-empty -- --all $ git log --follow foo/bar/some-file That has dropped all history for some-file prior to the git mv command.
Better suggestions? TIA.