更新和拉取有什么区别?
有人可以澄清 update 和 pull 命令之间的确切区别吗?
谢谢。
Can someone clarify what's the exact difference between update and pull commands?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
hg 更新:http://www.selenic.com/mercurial/hg.1。 html#update
hg pull :http://www.selenic.com/mercurial/hg.1.html#pull
因此,当您执行 hg pull 时,您对
.hg
下的存储库进行了更改。它不会反映在您的工作目录中。之后,当您执行
hg update
时,更改将被带到您的工作副本中。当来自像版本控制系统这样的颠覆时,这是非常常见的混乱。
在 subversion 中: svn update 将更改从中央存储库服务器带到您的工作副本,
但在 DVCS 中,您同时拥有本地存储库和工作副本。因此,更新的作用完全相同,但会将更改从本地存储库提取到本地工作副本。
hg update : http://www.selenic.com/mercurial/hg.1.html#update
hg pull : http://www.selenic.com/mercurial/hg.1.html#pull
So when you do an hg pull, you bring changes to your repository which is under
.hg
. It will not reflect in your working directory.After that, when you do a
hg update
, the changes are brought to your working copy.This is very usual confusion when coming from subversion like version control systems.
In subversion : svn update bring the changes from central repo server to your working copy
But in DVCSs , you have both a local repository and working copy. So update does exactly the same but pulls the changes from your local repo to local working copy.
Mercurial 是一个分布式修订控制系统,因此您拥有整个存储库历史记录以及代码版本(称为“工作副本”)。
pull
可以对本地存储库进行远程更改。update
更改您的工作副本以匹配本地存储库中的最新版本。因此,如果您克隆远程分支并继续运行更新,您的代码将不会更改,因为您永远不会下载远程代码。如果您继续运行 pull,那么您的代码将不会更改,因为您从未使用远程代码(将其应用到代码的工作版本)。
Mercurial is a distributed revision control system, so you have the whole repo history as well as your version of the code (called the "working copy").
pull
brings in remote changes to your local repo.update
changes your working copy to match the newest version in your local repo.So if you clone a remote branch and keep running update, your code won't change because you're never downloading remote code. If you keep running pull, then your code won't change because you're never using the remote code (applying it to your working version of the code).
pull 命令从父存储库中提取更改,但实际上并不对存储库中的文件进行任何更改。
更新命令用于实际更新存储库中的文件。
参考:
https://developer.mozilla.org/en-US/docs /Mercurial_FAQ#What%27s_the_difference_ Between_hg_pull_and_hg_update.3F
The pull command pulls changes from the parent repository but does not actually make any changes to the files in the repository.
Update command is used to actually update the files in the repository.
Refer:
https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#What%27s_the_difference_between_hg_pull_and_hg_update.3F
链接中的这张图片可以帮助理解它:
This picture from this link can help to understand it: