You can do what you are describing like this:
-
Move the content of
ABCto anABC/subdirectory, and fix the history so that it looks like it has always been there:$ cd /path/to/ABC $ git filter-branch --index-filter \ 'git ls-files -s | sed "s-\t-&ABC/-" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ git update-index --index-info && mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEADNow your directory structure is
ABC/ABC/your_code -
Same for the content of
DEF:$ cd /path/to/DEF $ git filter-branch --index-filter \ 'git ls-files -s | sed "s-\t-&DEF/-" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ git update-index --index-info && mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEADNow your directory structure is
DEF/DEF/your_code -
Finally, create the
PPPrepository and pull bothABCandDEFinto it:$ mkdir /path/to/PPP $ cd /path/to/PPP $ git init $ git pull /path/to/ABC $ git pull /path/to/DEFNow you have
PPP/ABC/your_codeandPPP/DEF/your_code, along with all the history.
You should probably ask you collegues to run the previous commands on their system, in order for everyone to be synchronized.
Note: the funky
filter-branchcommands come from the man page. 🙂