Mercurial: Fix a borked history

前端 未结 1 1387
面向向阳花
面向向阳花 2020-12-10 17:17

So working on a project recently (by myself - no other developers), I somehow managed to seriously bork the history with some (apparently) bad merges from cloned repositorie

相关标签:
1条回答
  • 2020-12-10 17:57

    Make a clone of your repository - when you do this, you can specify the last commit that should be cloned.

    So, if your repository has 100 changesets and you want to get rid of changesets 93 to 100, just do this:

    hg clone -r 92 BadRepository CleanRepository
    

    --> the CleanRepository will only contain changesets 1 to 92.

    If you use TortoiseHG, you can do the same in the Clone dialog (there is a textbox "Clone to revision:")

    0 讨论(0)
提交回复
热议问题