Why does “hg status” show changed files when “hg diff -g” doesn't? (One parent)

前端 未结 5 1125
借酒劲吻你
借酒劲吻你 2021-01-31 08:40

I have a repository where:

> hg st

shows that my working directory has some uncommitted changes, while

> hg diff


> h         


        
5条回答
  •  借酒劲吻你
    2021-01-31 09:00

    In these situations (it happens a lot to my team), I find that this command will fix about anything:

    hg debugrebuilddirstate
    

    or

    hg debugrebuilddirstate -r tip
    

    It's lightly documented in the help documentation, but basically I believe it clears out the "dirstate" file which caches information about working-directory files. The next time you hg stat it will refresh it from scratch.

    One caveat: if you've added or removed files, that information will be lost when the dirstate is rebuilt.

提交回复
热议问题