问题
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