組合多個git存儲庫假設我有一個看起來像phd/code/
phd/figures/
phd/thesis/由于歷史原因,這些機構都有自己的git存儲庫。但是我想把它們組合成一個,來簡化一些事情。例如,現在我可能會做兩組更改,并且必須執行以下操作cd phd/code
git commit
cd ../figures
git commit現在只要表演就好了cd phd
git commit似乎有幾種方法可以使用子模塊或從我的子存儲庫中提取,但這比我想要的要復雜一些。至少,我很高興cd phd
git init
git add [[everything that's already in my other repositories]]但這看起來不像是一條直線。里面有什么東西嗎?git能幫我的忙嗎?
3 回答

翻閱古今
TA貢獻1780條經驗 獲得超5個贊
git-stitch-repo
git-fast-export --all --date-order
git-fast-import

largeQ
TA貢獻2039條經驗 獲得超8個贊
$ cd phd/code $ mkdir code # This won't work literally, because * would also match the new code/ subdir, but you understand what I mean: $ git mv * code/ $ git commit -m "preparing the code directory for migration"
$ cd ../.. $ mkdir phd.all $ cd phd.all $ git init $ git pull ../phd/code ...
- 3 回答
- 0 關注
- 497 瀏覽
添加回答
舉報
0/150
提交
取消