Using Mercurial (hg), how to push just one file or one directory out?

☆樱花仙子☆ 提交于 2019-12-12 16:03:42

问题


Using Mercurial, we can commit one file by using

hg commit file.rb

or 1 folder

hg commit foldername

But how can we push just 1 file or 1 folder out?

The whole project can be pushed using

hg push ssh://peter@192.168.1.102//project/code/preliminary

but there seems to be no way to push out just 1 file or 1 folder?

I tried the following and they don't work:

hg push ssh://peter@192.168.1.102//project/code/preliminary app/views/index.html.erb

or

hg push ssh://peter@192.168.1.102//project/code/preliminary/app/views/index.html.erb

回答1:


That's not really possible to do with Mercurial. The whole point of Mercurial (and Subversion and git and pretty much every version-control system since CVS) is that you deal with changesets; each commit is a set of changes to one or more files. push and pull only know about commits, not about each part of every commit.



来源:https://stackoverflow.com/questions/3011498/using-mercurial-hg-how-to-push-just-one-file-or-one-directory-out

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