Amending a "public" changeset in Mercurial

9.8k Views Asked by At

I'd like to amend my last commit, but running

hg commit --amend

gives me

abort: cannot amend public changesets

even though I know that it's safe to edit the changeset. How can I change the phase of my last commit and/or tell Mercurial that it's safe to amend?

1

There are 1 best solutions below

3
On

On the Mercurial wiki, there's a good overview of phases.

To convert the current commit from "public" to "draft" commit in order to allow amending, use

hg phase --draft --force .

(or replace . with another revision if you want to edit a different changeset).