admin管理员组

文章数量:1406060

I have Mercurial Distributed SCM (version 6.1.1). I enabled and used the "uncommit" extension to solve the particular problem below, but I still want to know how I was supposed to do it with commit --amend.

Say I have modified 4 files, a,b,c,d and I want to commit only file "a". The intention is to run the command

hg commit -m "Only file a should be committed" ./a

but I accidentally hit return prematurely, and run

hg commit -m "Only file a should be committed"

This commits all the files a,b,c & d.

Obsolete info on the internet says to use hg rollback but rollback is no longer available. hg help -v rollback prints the message

Please use 'hg commit --amend' instead of rollback to correct mistakes in
the last commit.

But commit --amend is not rollback or undo, it merges current changes with the previous commit. So what would be a good way to use it in this scenario?

本文标签: