git 强制合并 - 已经是最新的

git force merge - Already Up To Date

是否可以在更改已合并到分支中时将标记合并到分支中?我正在尝试填充 gitk

中的 Precedes

编辑:当我这样做时 git merge <TAG> 它无法合并,因为分支没有任何差异。

编辑2: 我们正在使用一个 gitflow 进程,其中有 master、develop 和 PTR 分支。 我们的过程是从开发中创建一个发布分支。一旦测试发布分支被压缩并合并到主分支。压缩的提交被标记在 master 上。然后tag再合并回release分支再合并到develop。我们 运行 遇到的问题是发布时提交不在标记之前。这使得验证提交是否是构建的一部分变得困难

when the changes are already incorporated into the branch?

这意味着:

-x--x--x--x--x (master)
         /
 -y--y--y--y--y (abranch)
        |
     (tagT)

由于标签引用了一个已经合并到 master 的提交,ant git merge <atag> 将是 no-op.
而且标签不会成为主分支的一部分,它仍然是分支的一部分。

这意味着 git branch --contain <aTag> 将不包括 master
另见“Verify if a tag was done in the master branch”。


在 OP 提供的新 gitflow 上下文中:

Our process is to make a release branch from develop.
Once tested the release branch is squashed and merged to master
The squashed commit is tagged on master

                 (aTag)
                   |
   -m--m--m--m--m--R (master, with release squashed-commit)
         
     r--r--r--r (release)
    /
-d--d--d (develop)

Then tag is then merged back to the release branch and then merged to develop

                 (aTag)
                   |
   -m--m--m--m--m--R   (master, with release squashed-commit)
                    \------------\
     r--r--r--r-----r' (release)  \
    /                              \
-d--d--d---------------------------d' (develop)

The issue we're running into is commits on release do not Precede the tag. It makes it difficult to verify if a commit was part of a build

来自架构:

然后该提交是“aTag”构建的一部分。

问题,确实是:

The problem is in gitk, r1,r2,r3,r4 do not show a Precedes: <tag> that was merged in r'

我同意。 Gitk 将无法显示该标签。
为了更好地了解 Gitk 中的“Precedes”部分,我会在 r' 中添加一个标签,其名称与 aTag 相似。