我們使用 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,說明衝突不是在文件的內容上。
問題解決。