在 git
中 pull 并使用我的本地存储库的最新更改我正在使用 git pull
。
在 hg
中,我也使用 hg pull
但它会打印
运行“hg update”以获取工作副本
我确实运行了 hg update
但我想知道为什么这与 git
不同?
最佳答案
其他答案实际上并没有回答这个问题,即:为什么 Git 和 Mercurial 的工作方式不同?有哲学上的区别吗?
在 Mercurial 中,pull
与 push
相反:它在不触及工作副本的情况下将本地仓库与远程仓库同步。所以它更一致。
在Git中,pull
是一个fetch
加一个merge
,或者一个pull
加一个以 Mercurial 术语更新
。通常这就是你想要的。所以效率更高。
Distributed Version Control University talk在 4-minute mark 处有一张幻灯片这清楚地展示了 Mercurial 的工作方式。迈克尔恩斯特的 Version control concepts and best practices有一个类似的图表(包括在下面):
关于git - 为什么在 git 中 hg pull 之后我需要 hg update 我只做 git pull,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19270303/