"commit --amend" and extraneous files

Victor Sudakov vas at sibptus.ru
Tue Feb 4 13:25:34 UTC 2020


Malcolm Matalka wrote:
> 
> >
> > If I wanted to commit just several files:
> >
> > hg commit -m "Foo" file1.c file2.c
> >
> > and instead committed the whole working dir:
> >
> > hg commit -m "Foo"
> >
> > What is the right way to amend the problem (so that files other than
> > file1.c and file2.c become uncommitted again)?
> 
> Check out `hg backout` and `hg histedit` (I think they require an
> extension.

I can also probably `hg strip` the tip revision, but are you sure the
desired effect cannot be achieved with "commit --amend" as stated in the
subject line?

And I don't want to use `hg backout` because I don't want to keep the
erroneous commit in the repo.


-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49 at fidonet http://vas.tomsk.ru/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20200204/853a16fd/attachment.asc>


More information about the Mercurial mailing list