Merge git --squash branch into master 没有出现在 gitlab 网站上?

Merge git --squash branch into master does not appear in gitlab website?

我将名为 SGMII 的开发分支与 --squash 选项合并到主分支中,如下所示:

git checkout master
git pull origin master
git merge --squash SGMII
git commit -m "merge SGMII into master"
git push

但是在gitlab网站上查看,并没有显示合并:

此外,SGMII 分支未标记为 merged。你知道为什么它们不一致吗?

您可以看到 git merge --squash illustrated here:它不会产生合并提交。

Produce the working tree and index state as if a real merge happened (except for the merge information), but:

  • do not actually make a commit,
  • do no move the HEAD, or
  • do not record $GIT_DIR/MERGE_HEAD (to cause the next git commit command to create a merge commit).

Therefore, the SGMII branch and the master should be equal (and in fact, they are). But the compare marks it differently.

如果 master 配置正确,git push 命令应该已将本地 master 推送到其远程 GitLab 存储库 origin/master 上游分支。