2016-07-27 78 views
1

當試圖合併github上的請求時,發生了衝突,其中repo可從https://github.com/my_production_repo/my_app.git進行復制。解決拉請求衝突時如何強制git pull

於是跟隨他們的文檔,我想在我的本地(productio_repo)運行此

git checkout -b tmp master 
git pull https://github.com/my_forked_repo/my_app.git master 

然後,我有一些衝突來解決。問題是有些衝突與byte-code files有關。我想迫使我的本地文件可以通過將文件從my_forked_repo覆蓋,我想這

git merge -s recursive -X theirs https://github.com/my_forked_repo/my_app.git master 

,但我得到了https://github.com/my_forked_repo/my_app.git - not something we can merge

+2

你被git pull引入歧途。 'pull'命令對於兩個單獨的命令來說只是一個便捷的快捷方式:'git fetch',它可以讓你從另一個倉庫(比如叉子)檢索提交到你自己的倉庫中的提交和'git merge',這需要你在自己的回購中進行提交。你不能提供'git merge'的URL,只能提供'git fetch'。 – torek

+0

可能你可以試試[this](https://stackoverflow.com/a/35442565/2303202)。請注意,其中一個編輯處理整個目錄,對於單個文件的第一個版本更好 – max630

回答

0

如果它不是很多文件,你可以嘗試在所有的人都使用git reset HEAD byte-code.file

並記住你需要在合併之前提交你的修改,也許那麼它會工作。

+0

我甚至沒有成功完成所有文件的git重置 – user1611830

+0

Dunno然後,檢查http://stackoverflow.com/questions/14680711/如何對-DO-A-github上拉請求 – RaV