Mercurial 中克隆和拉取的区别
克隆和拉取,这些操作 两者的功能相似,那么使用克隆代替拉取有意义吗? 我的意思是,如果可以通过拉取现有存储库来实现相同的目标,为什么我应该使用克隆。
一个团队正在开发某个应用程序,后来有一个新用户说 user2 由公司分配给该应用程序,然后克隆现有存储库或拉取现有存储库以获取新条目(用户 2),哪一个更好?黑白比较克隆/拉取
Clone and pull, these operations
both are similar in functioning, so does using clone instead of pull make any sense?
I mean why should I use clone if it is possible to achieve same thing by pulling an existing repo.
A team working on some application and later a new user say user2 allotted to that application by company then cloning existing repo or pulling existing repo for new entry(user2), which 1 is better? comparison b/w clone/pull
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
拉意味着您已经有一个本地存储库,并且您只从远程存储库中提取本地存储库中尚未存在的最新更改。
但是,如果您还没有本地存储库,克隆会创建一个新存储库,将远程存储库中的所有内容提取到新的本地存储库中,并将工作副本更新到最新版本。
如果您加入一个新项目,这是最简单的开始方法 - 您需要从一开始就获取所有代码。
您还可以手动执行克隆步骤,这具有完全相同的效果(但仅执行
hg clone https://url_to_remote
更容易):hg init
)hg pull https://url_to_remote
)hg update
)Pulling means that you already have a local repository, and you pull in just the newest changes from the remote repository that are not in your local repository yet.
But if you don't have a local repository yet, cloning creates a new one, pulls everything from the remote repository into your new local repository and updates your working copy to the newest version.
This is the easiest way to start if you join a new project - you need to get all the code once in the beginning.
You can also do the steps for cloning manually, which has the exact same effect (but just doing
hg clone https://url_to_remote
is easier):hg init
)hg pull https://url_to_remote
)hg update
)这两个命令完全不同:
首先克隆一个存储库。之后,每当您想要更新此克隆以引入另一个存储库的更改时,您都可以拉取。
These 2 commands are completly different:
First you clone a repository. After that, whenever you want to update this clone bringing the changes from another repo, you pull.
当您克隆存储库时,您将制作一个新副本,这可能是一个昂贵的过程。此外,如果您仅使用克隆,那么您将面临丢失可能所做的任何本地更改的风险。
当您拉取时,这只会使用对父存储库所做的任何更改来更新您的存储库,因为它只是合并差异,这将是一个更有效的过程。
我建议您阅读本教程:http://hginit.com/< /a>
When you clone a repository then you are making a new copy, this can be an expensive process. Also if you only use clone then you will risk losing any local changes you may have made.
When you pull then this just updates your repository with any changes that have been made on the parent repository, as it is just incorporating differences this will be a much more efficient process.
I recommend you go though this tutorial: http://hginit.com/