You can do what you are describing like this:
Move the content of ABC
to an ABC/
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--&ABC/-" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new
git update-index --index-info &&
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD
Now 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--&DEF/-" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new
git update-index --index-info &&
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD
Now your directory structure is DEF/DEF/your_code
Finally, create the PPP
repository and pull both ABC
and DEF
into it:
$ mkdir /path/to/PPP
$ cd /path/to/PPP
$ git init
$ git pull /path/to/ABC
$ git pull /path/to/DEF
Now you have PPP/ABC/your_code
and PPP/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-branch
commands come from the man page. :-)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…