version-control - Mercurial:如何拉取和更新特定标签

标签 version-control mercurial

我想从远程存储库中提取最新的变更集,同时将我的本地存储库更新为某个标签。与 hg fetchhg 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/

相关文章:

android - Git 存储库突然不再更新,即使它在 Android Studio 端提交/推送正常

python - 我可以使用 bazaar 提交一个大文件,还是有更好的方法来对数据库转储进行版本控制?

version-control - 如何在每次 Emacs 启动时创建 .emacs 备份

linux - 在 Ubuntu Linux 上构建 Mercurial 1.3.1

mercurial - Mercurial 存储库如何随着时间的推移而增长?

python - 将 SCCS 存储库转换为 SVN

ios - iOS团队开发中如何管理共享资源?

java - 我如何拒绝破坏构建的多变 checkin ?

svn - Mercurial : how to convert a single subversion branch

git - Mercurial 书签和 'Git like branching'