使用Mercurial(hg),如何仅推出一个文件或一个目录? [英] Using Mercurial (hg), how to push just one file or one directory out?

查看:126
本文介绍了使用Mercurial(hg),如何仅推出一个文件或一个目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Mercurial,我们可以使用来提交一个文件

Using Mercurial, we can commit one file by using

hg commit file.rb

或1个文件夹

hg commit foldername

但是我们如何只推出1个文件或1个文件夹?

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

可以使用

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

但是似乎没有办法只推出1个文件或1个文件夹?

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

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

推荐答案

使用Mercurial真的不可能这样做. Mercurial(以及从CVS开始的Subversion和git以及几乎所有版本控制系统)的重点是您要处理变更集;每次提交都是对一个或多个文件的一组更改.推和拉仅了解提交,而不了解每次提交的每个部分.

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.

这篇关于使用Mercurial(hg),如何仅推出一个文件或一个目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆