How can I force mercurial to accept an empty commit

后端 未结 5 1171
说谎
说谎 2020-12-20 17:40

I\'m trying to convert an SVN repo with hgsvn and I have some commits where SVN properties where modified, but since Mercurial doesn\'t use those, it sees this

5条回答
  •  遥遥无期
    2020-12-20 18:20

    As per @vorrtex's comment on the original question, the simplest method to force an empty commit in Mercurial is as follows:

    1. Add a new file (say, Dummy.txt) and commit.
    2. hg forget Dummy.txt
    3. hg commit --amend

    This will remove Dummy.txt from the previous commit, leaving it empty. (You can use e.g. TortoiseHg for step 1 but you'll need to use a command line tool for steps 2 and 3.)

    I'm adding this as a new answer because when scanning this thread originally I missed the comment, and the existing answers don't create a truly empty commit.

提交回复
热议问题