Git-把其他远程仓库的代码合并到当前分支


# 查看远程仓库
git remote

# 添加新的远程仓库
git remote add RemoteName url

# 获取新的远程仓库的信息
git fetch RemoteName

# 签出需要合并的分支
git checkout -b newLocalBranchName RemoteName/xxxxxbranchName

# 查看所有分支
git branch -a 

# 签出要操作的分支
git checkout dev

# 分支合并
git merge newLocalBranchName

# 推送到远程仓库
git push

文章作者: 钱不寒
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 钱不寒 !
  目录