Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amending a "public" changeset in Mercurial

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?

like image 838
Sophie Alpert Avatar asked Aug 25 '12 20:08

Sophie Alpert


1 Answers

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).

like image 56
Sophie Alpert Avatar answered Sep 23 '22 07:09

Sophie Alpert