2016-12-01 16 views

回答

7

使用git checkout--ours--theirs需要至少一個參數:要檢出的文件/目錄的路徑。

由於the manual說:

When checking out paths from the index, check out stage #2 (ours) or #3 (theirs) for unmerged paths.

所以:

git checkout --ours <path(s)> 
+0

有趣的是,在隱身瀏覽器,谷歌只看到這整個錯誤字符串的單個時間:在[這個答案]發表評論(http://stackoverflow.com/a/28782831/5353461)。如果沒有'致命'的序言,它會增加5倍。爲什麼不在源代碼中拾取我想知道的字符串? –

+1

因爲它不是單個字符串:https://github.com/git/git/git/blob/master/builtin/checkout.c#L1085-L1086 – torek

+0

git checkout --ours 將無法​​使用分支名稱。問題是如何切換到一個分支,自動解決與-ours策略的合併衝突 – electrodrel