拉取远程分支
您可以使用 git pull 命令将远程存储库中的最新更改应用到本地存储库。
例如,假设远程分支位于本地分支的上游。远程分支将包含本地分支的所有更改,如下所示。

在这种情况下,如果我们要将远程分支 (origin/main) 的合并应用到我们的本地分支 (main),这将是一个快进合并。

但是如果本地 main 分支中的更改不存在于远程 origin/main 分支中,则拉取命令将执行合并,且将创建将这些更改绑定在一起的合并提交。

执行拉取时,会在本地存储库中自动创建合并提交。如果存在冲突,您将必须解决冲突并手动提交合并。

如果没有冲突,提交将自动合并。