简体   繁体   English

Mercurial命令结合hg pull; hg up

[英]Mercurial command to combine hg pull; hg up

如何将Mercurial命令hg pullhg update合并为一个?

Obviously, hg pull -u is the answer here. 显然, hg pull -u就是这里的答案。

However, there's a caveat that deserves mentioning: hg pull -u is not exactly equivalent to hg pull && hg update . 然而,值得一提的是一个警告: hg pull -u并不完全等同于hg pull && hg update This is briefly mentioned in the documentation, but it can be surprising if you first run into it; 文档中对此进行了简要介绍,但如果您第一次遇到它,可能会令人惊讶; if there's nothing to pull (eg no new changesets came in), then hg pull -u doesn't update. 如果没有什么可以拉(例如没有新的变更集进来),那么hg pull -u不会更新。 This can be slightly confusing if you weren't on a head before issuing the command. 如果您在发出命令之前没有头脑,这可能会有点混乱。

键入hg help pull ,你会看到-u开关

You can use: 您可以使用:

hg pull -u

Read the documentation for more options. 阅读文档以获取更多选项。

The hg fetch extension will do the same once enabled. 一旦启用, hg fetch扩展将执行相同的操作。 However, it has fallen out of favor and is noted as an "unloved feature" by the Mercurial team. 然而,它已经失宠,并被Mercurial团队称为“不受欢迎的功能”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM