git push merge error, but git pull is already up-to-date. Tried reclone, same problem

后端 未结 5 1394
臣服心动
臣服心动 2021-02-10 03:37

I do:

$ git commit .
$ git push
error: Entry \'file.php\' not uptodate. Cannot merge.

Then I do

$ git pull
Already up-to-date.
         


        
5条回答
  •  逝去的感伤
    2021-02-10 04:28

    Try to do a git status and check if you've got any non commited changes to 'file.php'. You need to commit all the changes on the same files, or git could change your non-commited file.

    Try to make another commit after the pull, and then try to pull again, review any possible merge and push the data.

    If you want just to overwrite your local copy, checkout the file file.php (git checkout HEAD^ file.php to checked version previous to last one) to a previous version, and then pull from the repository.

提交回复
热议问题