Git pull: error: Entry foo not uptodate. Cannot merge

后端 未结 11 1930
不思量自难忘°
不思量自难忘° 2020-11-30 20:09

I\'m trying to update my repo from a remote branch and keep getting this error when I do a \"git pull\". I haven\'t made any local changes, and even if I have I don\'t need

相关标签:
11条回答
  • 2020-11-30 20:50

    Worth a try:

    Could you set, just for this update, set the config parameter core.trustctime to false?

    core.trustctime
    

    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).

    0 讨论(0)
  • 2020-11-30 20:55

    Generally speaking, this means you have changes in your local files that haven't been committed to your local repository. You can also see this stackoverflow question for a bit more detail.

    0 讨论(0)
  • 2020-11-30 20:56

    It might a problem also with file permissions. Git is versioning them too, unless config says otherwise. Just adding this answer for people who has almost but not the like problem.

    0 讨论(0)
  • 2020-11-30 20:57

    I had the same error, after a situation where git status said new file: foo.cpp for a file not added to the staging area. i.e. under the "Changes not staged for commit" heading. Very weird, this usually doesn't happen.

    Solution: git add foo.cpp, and then git stash worked again.

    0 讨论(0)
  • 2020-11-30 21:00

    I was seeing a similar issue (Windows 10): I was on branchA and wanted to go to master. I had some uncommited changes so first I git stash then git checkout -f master but I still got the Entry 'fileName' not uptodate. Cannot merge.

    git status wasn't showing anything to commit.

    Eventually I just removed the file manually and I was able to go to the other branch (which of course made my file come back) so I guess there has been a bug within git somewhere.

    0 讨论(0)
提交回复
热议问题