Check in single file with Mercurial?

别等时光非礼了梦想. 提交于 2019-11-30 16:23:41

问题


Let's say you do hg status and you have three files modified. I know how to check in all three files (hg commit). But how can you check in (and then hg push) just one of the modified files?


回答1:


Please check the output of hg help commit which reveals that you can do

hg commit foo.c

if you just want to commit a single file. This is just like Subversion and many other systems — no hocus-pocus :-)




回答2:


Just do:

hg ci -I path/to/file -m "commited only one file"

That commits only one file, and you can push it, and none of the uncommitted changes will be affected.




回答3:


On the off chance you're running on Windows, TortoiseHG (a graphical Mercurial interface) lets you select which files to commit every time.



来源:https://stackoverflow.com/questions/2908102/check-in-single-file-with-mercurial

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!