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

翻過(guò)高山走不出你
TA貢獻(xiàn)1875條經(jīng)驗(yàn) 獲得超3個(gè)贊
git-stitch-repo
git-fast-export --all --date-order
git-fast-import

largeQ
TA貢獻(xiàn)2039條經(jīng)驗(yàn) 獲得超8個(gè)贊
$ 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 關(guān)注
- 447 瀏覽
添加回答
舉報(bào)
0/150
提交
取消