I’ve created a repository in the project’s directory. I’ve added all the files and made some commits. Then I added new files to project and to repository. After that I returned to earlier version and now I can’t update to last version. After hg update tip I’m getting this message:
abort: untracked file in working directory differs from file in requested
revision: '.DS_Store'
I’m new to mercurial. How can I fix this?
It means that Mercurial is unsure about what to do. You have a file with content
somethingin the working copy. The file is not version controlled, so Mercurial will normally leave it alone when you update. However, the revision you’re updating to also has a file with the same name, and the content differs from thesomethingyou already have in the file.You can get this problem if you do
You now have two revisions, the latest has files
aandb. If you update back to the first revision and create a different fileb, then you get trouble:The normal solution is to commit before updating. You should generally not update with a dirty working copy (“dirty” means that
hg statusisn’t empty). Mercurial does support such updates, but you should only use them if you know what you’re doing.So to continue the example above we can either commit the new
band then merge:This gives a conflict in
bsince the two versions containb fileandother b file, respectively. Resolve the conflict and commit:An alternative is to delete the file from the working copy. That is what I’ll do in your case:
.DS_Storefiles should not be tracked in the first place. They store some folder information on Mac OS X and this is not part of your source code. So you doThe update resurrected the
.DS_Storefile. You now want to tell Mercurial that it should stop tracking the file:and you also want to tell Mercurial to ignore such files from now on: