Mercurial - cannot commit merge with missing files error

17,072

Solution 1

Try hg status and look for files in state ! (missing).

The cause is that one of the files which is part of the merge has been deleted. Undelete the file and try again.

Solution 2

Heres my approach

hg status will tell you what files are missing. Then you can either restore the file from somewhere

OR type in hg remove <path/name of missing file>

THEN commit. Your repo will be sane again, darwin willing.

Solution 3

If you are using TortoiseHG, click in View/Commit. It will show you files in state ! (missing).

Right click on the file and choose Revert (undelete the file) and commit.

Share:
17,072
Zabs
Author by

Zabs

PHP Developer

Updated on June 15, 2022

Comments

  • Zabs
    Zabs about 2 years

    I have done a 'hg merge' however when I attempt to do a 'hg commit -m "my msg.." I get the following error message :

    abort: cannot commit merge with missing files
    

    Can anyone explain how to fix this to allow the commit go through?

  • smeeb
    smeeb about 8 years
    This is the answer the worked for me. Had to manually hg remove the file. Another "would have just worked in Git" gotchya....
  • Spongman
    Spongman almost 5 years
    what if no files have the ! state?
  • Aaron Digulla
    Aaron Digulla almost 5 years
    @Spongman That shouldn't happen. What file states do you see when you run hg status?