Mercurial: “untracked file in working directory differs from file in requested revision”?

后端 未结 5 1708
梦如初夏
梦如初夏 2021-02-03 16:47

Can anyone tell me what this Mercurial error means?

untracked file in working directory differs from file in requested revision

5条回答
  •  灰色年华
    2021-02-03 17:17

    It's telling you you already have a file named a/b/c/d.java in your local working directory of the myapp repo, but it hasn't been added (tracked), and fetch isn't willing to overwrite it when updating/merging.

    Things you can do are ether:

    • Move your copy of a/b/c/d.java out of the way and then do the pull/update. After that compare your moved a/b/c/d.java to the one fetch brings down.

    or

    • hg add a/b/c/d.java, hg commit a/b/c/d.java, and then pull / merge

    The former works because there's no longer a file in the way, and the later works because your copy is tracked so Mercurial can merge them.

    Also, you should consider stopping using fetch. It combines pull and update and merge for you, which is just not a safe way to be. In this case your pull would have succeeded and both update and merge would have given you much more helpful messages.

提交回复
热议问题