git 合并主币与 git 合并主币有什么区别

what's the difference between git merge master vs git merge master coins

假设我在 coins 分行结账,我 运行 这个命令有什么区别。什么时候才能有区别。我是 git 的新手,所以探索文档让我更加困惑。

我想知道

的效果有什么区别

git merge master

git merge master coins

不同之处在于,第一个会将分支 master 合并到您的分支中,第二个将尝试将 master 和分支 coins 合并到您的分支中。

From the manual:

<commit>...

Commits, usually other branch heads, to merge into our branch. Specifying more than one commit will create a merge with more than two parents (affectionately called an Octopus merge).

If no commit is given from the command line, and if merge.defaultToUpstream configuration variable is set, merge the remote-tracking branches that the current branch is configured to use as its upstream. See also the configuration section of this manual page.

因为你已经在分支 coins 上,就 git 而言,它已经被合并了。所以最终结果只是合并到 master 中。但如果你在不同的分支上,它会合并所有三个(master、coins 和你所在的分支)。