如何合并这两个分支?

问题描述 投票:0回答:1

enter image description here

首先,我刚刚开始学习git。

我想将红色分支合并到其他分支中,但是没有合并按钮。

其实本质上我也不知道他们为什么要分开。

enter image description here

git merge branch gitkraken
1个回答
0
投票
  1. 打开终端,(可以是独立终端,也可以是 VSCode 的内置终端,没关系)。
  2. 使用
    git status
    命令检查您当前所在的分支。 如果您不在要合并的分支上,请使用
    git switch [branchname]
    切换到该分支,例如。
    git switch main
  3. 然后使用
    git merge [branchname]
    合并分支,例如。
    git merge featureA

上述步骤将名为

featureA
的分支合并到
main
分支

© www.soinside.com 2019 - 2024. All rights reserved.