Can anyone tell me what this Mercurial error means?
untracked file in working directory differs from file in requested revision
I got around this by running hg update --clean
Just accept the error dialog then tick Discard local changes, no backup
And you should be good, it will overwrite any untracked local files...
If using TortoiseHG you can check the "Discard local changes, no backup" option in the Update window.
I tried Ry4an's answer (of deleting the file) and it still did not work, so I ran a purge and that got rid of all traces such that it worked after. Just in case somebody is looking for an alternative solution.
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:
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 / mergeThe 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.