git - 如何从原始存储库中获取我的分支中的新分支?

标签 git

我 fork 了一个仓库,原来的仓库在我 fork 后得到了一个新的分支。

OriginalRepo
   |
   +-BranchA
   |
   +-newBranch


MyFork
   |
   +-BranchA

我想把分支 newBranch 放到我的 fork 中,我该怎么做?

最佳答案

git remote add OriginalRepo repository-URL
git fetch OriginalRepo
git checkout newBranch
git push origin newBranch

关于git - 如何从原始存储库中获取我的分支中的新分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33488085/

相关文章:

Git 提交 -a "untracked files"吗?

git - 如何修复 git 错误 : RPC failed; curl 56 GnuTLS

git - 协议(protocol)错误 : expected old/new/ref, 得到 'shallow deeb...'

git - 安装 BugZilla perl 依赖项后尝试配置 gitweb 时出现 XML 解析错误

git - 有人可以解释 'git revert ...'

git - Heroku 可以在部署时忽略 git 子模块吗?

Git merge : parallel identical additions are merged without conflict by including the same code block TWICE in the merged file without complaint. 为什么?

git - .gitignore 排除文件夹但包含特定子文件夹

git - 详细的 git checkout

php - 如何更新开源代码的修改版本?