git - 将主控转发到标签

标签 git

  • 我致力于掌握
  • 我使用 git tag -v v1.7 -m "foo" 为此次提交创建了一个标签
  • 我 checkout 了一个标签 git checkout v1.7 (master 指向相同的提交 ID)
  • 然后我创建了一个提交
  • 然后我使用 git tag -v v1.8 -m "bar"标记此提交

如何让 master 与标签 v1.8 具有相同的提交 ID

最佳答案

How do I get master to be at the same commit ID as the tag v1.8

如果在您创建 v1.8master 上没有新的提交, 然后您可以切换到它并从 v1.8 merge 以使 master 快进到 v1.8:

git checkout master
git merge v1.8

关于git - 将主控转发到标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46620622/

相关文章:

git - 仅 merge git 分支中的增量更改

git - 在 Gitlab 的 Sourcetree 中创建 "Pull request"

git - 如何暂时忽略 git pull 上未跟踪的文件?

git - 为所有存储库自定义 .git 深度?

git - GOGS key

git - 我是怎么得到一个分离的 HEAD 的?

git - 在 git-show 上默认设置 color-words 选项

带有 git 扩展的 git-svn 停留在身份验证领域

git - Jenkins 连接到 stash 时出错

Git pull - 删除的文件