git mergetool报告"没有文件需要合并"

Chr*_*lay 38 git git-merge

由于某些原因,最近每次拉动并发生合并冲突时,运行git mergetool报告"没有文件需要合并":

$ git pull
First, rewinding head to replay your work on top of it...
Applying: replaced home button with Cancel
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
error: Your local changes to the following files would be overwritten by merge:
    Classes/Controllers/HomeController.m
Please, commit your changes or stash them before you can merge.
Aborting
Failed to merge in the changes.
Patch failed at 0002 moved rollback into cancel button in log watching

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".

$ git mergetool
No files need merging
Run Code Online (Sandbox Code Playgroud)

如果我git rebase --abort再次运行和拉动,则在不同的冲突上发生相同的事情,或者拉动成功而没有合并冲突.这些拉动之间没有任何远程变化,因此冲突并没有消失.

以下是此分支和远程配置的方式:

[branch "develop"]
        remote = origin
        merge = refs/heads/develop
        rebase = true
[remote "origin"]
        url = <my repo url>
        fetch = +refs/heads/*:refs/remotes/origin/*
Run Code Online (Sandbox Code Playgroud)

Jos*_*osh 18

这为我修好了:
git mergetool .

我在这里发现了这个问题

  • 也不适合我。 (3认同)
  • 在 git 版本 2.18.0 上工作。现在我们只需要了解为什么。 (2认同)

Chr*_*lay 16

看起来我的问题与文件时间戳有关.感谢Mark Longair建议的这个答案,以下设置为我解决了这个问题:

git config --global core.trustctime false
Run Code Online (Sandbox Code Playgroud)

  • 也不适合我。 (2认同)

IPr*_*ory 12

琐碎的解决方案

这对我有用:Git在冲突文件所在的同一目录中创建了一些与合并相关的文件,所以请记住以git mergetool正确的路径运行.


lij*_*nma 5

解决方案1:

$git config --global core.trustctime false
Run Code Online (Sandbox Code Playgroud)

如果为false,则忽略索引与工作副本之间的ctime差异; 当gode(文件系统爬虫和一些备份系统)之外的某些东西定期修改inode更改时间时非常有用.和core.trustctime默认为true.

解决方案2:只是:

$git rebase --skip
Run Code Online (Sandbox Code Playgroud)

您可以跳过它