Is there any way to delete local commits in Mercurial?

后端 未结 10 1061
小鲜肉
小鲜肉 2020-11-28 19:11

So I keep making a silly mistake in Mercurial. Often times, I\'ll start work without doing an \"hg pull\" and an \"hg update.\" When I try to push my changes, I get an err

10条回答
  •  旧时难觅i
    2020-11-28 19:42

    Modern answer (only relevant after Mercurial 2.1):

    Use Phases and mark the revision(s) that you don't want to share as secret (private). That way when you push they won't get sent.

    In TortoiseHG you can right click on a commit to change its phase.

    Also: You can also use the extension "rebase" to move your local commits to the head of the shared repository after you pull.

提交回复
热议问题