Git rebase、pull、push 出現 conflict 後不能merge的解決方案

來源:互聯網
上載者:User

我們使用 Git rebase 、pull 和 push的時候,經常會遇到衝突,這個時候我們會去merge:

$ git rebase master

出現衝突:

$ git mergetool -t opendiff

然後使用 opendiff 對 衝突的地方進行手動 merge。


但是,今天我遇見了不能merge的情況,問題如下:

$ git mergetool -t opendiff
$ no files need merging

提示我沒有檔案需要merging,在google上查到瞭解決方法,一般有兩種:


第一種:

$git config --global core.trustctime false

以上一句話的解釋是:

If false, the ctime differences between the index and the working copy are ignored; useful when the inode change time is regularly modified by something outside Git (file system crawlers and some backup systems). and core.trustctime is true by default.

所以,直接設定成false,沒有什麼大礙,只要代碼的內容一致就沒有問題。


第二種:

$git rebase --skip

可以直接 skip,因為沒有檔案需要merging,說明衝突不是在檔案的內容上。


問題解決。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.