abort: untracked file in working directory differs from file in requested revision: '.hgignore'

15,606

I think you have created a .hgignore in your working directory without adding it to the repository (hg add). This file is "untracked".

Someone else, from another clone, has added this file too, committed and pushed it. Now, when you try to update your working directory, Mercurial try to add this file but sees a file with the same name in your working directory which is untracked and different.

There's two solution to your problem :

  1. Backup your .hgignore file, do the update and add the differences from the backup if necessary
  2. Add your own file to the repository with hg add, then re-run the update. It will maybe be necessary to commit the file prior to the update.

I'll advise using the first solution.

Share:
15,606

Related videos on Youtube

learning
Author by

learning

Updated on May 23, 2022

Comments

  • learning
    learning about 2 years

    I am trying to pull some files and directories and I am having the following messages:

    When I look in my repository I can see that the files have been downloaded but all contains _ as prefix, and even the names of files and folders contain _

    requesting all changes 
    adding changesets 
    adding manifests 
    adding file changes 
    added 1094 changesets with 4304 changes to 1071 files abort:
    untracked file in working directory differs from file in requested revision: '.hgignore' [command interrupted]
    

    What is wrong?

  • Goke Obasa
    Goke Obasa over 7 years
    Solution number 1 worked for me, I moved the said file and everything was fine. Thank you