我想从远程存储库中提取最新的变更集,同时将我的本地存储库更新为某个标签
。与 hg fetch
或 hg pull -u
类似,但对标签进行了更新。在两行代码中,这是:
hg pull
hg update mytag
hg pull --help
揭示了以下内容,但不幸的是它们都不适用于标签:
options:
-u --update update to new branch head if changesets were pulled
-f --force run even when remote repository is unrelated
-r --rev REV [+] a remote changeset intended to be added
-B --bookmark BOOKMARK [+] bookmark to pull
-b --branch BRANCH [+] a specific branch you would like to pull
-e --ssh CMD specify ssh command to use
--remotecmd CMD specify hg command to run on the remote side
--insecure do not verify server certificate (ignoring web.cacerts config)
我尝试过的:
hg pull -r mytag only pulls the latest changesets, but no update
hg pull -u pulls and updates to tip, but no tag allowed
hg pull -b mytag abort: unknown branch
hg pull -B mytag abort: remote bookmark mytag not found
是否可以一行完成?
最佳答案
使用 vanilla Mercurial,没有命令可以拉取和更新某个标签、修订版或其他内容。
hg pull
hg update mytag
或
hg pull
hg update -r REVNUMBER
会很好地完成这项工作,我不会用别名和函数使它复杂化,这样我就不用再执行一个额外的命令了。
关于version-control - Mercurial:如何拉取和更新特定标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41265953/