Git rebase、pull、push 出现 conflict 后不能merge的解决方法

我们使用 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,说明冲突不是在文件的内容上。


问题解决。

你可能感兴趣的:(技术积累)