0
我想在我的項目的子目錄中合併遠程回購。幾天前我手工複製了這個遠程項目作爲我的項目中的子目錄,並對其進行了修改。現在有了它的新版本,我想合併我的子目錄中的新更改而不會丟失我的修改。如何在我的項目的子目錄中合併遠程回購?
結構:
myProject
/mySubproject1
/mySubproject2 <-- This one is the modified remote repo (from Github)
我已經嘗試過什麼是以下鏈接,但沒有成功:
- How do I merge a sub directory in git?
- http://bneijt.nl/blog/post/merge-a-subdirectory-of-another-repository-with-git
這是我做了什麼:
cd myProject
git remote add -mySubproject2_github https://github.com/something.git
git merge -s ours --no-commit mySubproject2_github/master
git read-tree --prefix=mySubproject2 -u mySubproject2_github/master
但我得到以下
error: Entry 'mySubproject2/.something.yml' overlaps with 'mySubproject2/.something.yml'. Cannot bind.
是否有可能我想要什麼?任何想法如何解決它?
添加到我們的項目
更新項目如果你希望在你的項目中這個項目*和*要保持它到-date,你可能想閱讀「git submodules」。 – larsks
@larsks我可以修改項目,當我更新項目時,我可以維護修改嗎? –
@ @ @ @ @ @ @ @ @ @ @ @你可以維護一個從上游拉動並維持你的改變的叉子。所以你理想上需要一個單獨的回購。 – rubenvb