最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

mercurial - How do you use hg commit --amend to replicate the functionality of the deprecated hg rollback - Stack Overflow

programmeradmin0浏览0评论

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?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论