push 的 src 和 dst 会一样吗?

Do src and dst of push will be the same?

我们知道如果 push 命令使用带有 + 符号的 refspec,它将完全覆盖 dstnon-fast-forward 更新)所以 dstsrc 是一样的。但是,如果发生 fast-forward 更新,情况是否如此?

But is that true if a fast-forward update occurs?

是的,考虑快进只是将远程头 dst 移动到 src(因为 src 只添加新提交)

--r--r--r--o--o--o (src)
        |
   (origin/dst)

git push +src:dst

--r--r--r--o--o--o (src)
                 |
            (origin/dst)

来自git push

By having the optional leading +, you can tell Git to update the <dst> ref even if it is not allowed by default (e.g., it is not a fast-forward.)

这意味着:如果推送是快进推送,则“+”无效。