首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >git克隆回购A到新的回购B,同时仍从回购A获得更新

git克隆回购A到新的回购B,同时仍从回购A获得更新
EN

Stack Overflow用户
提问于 2020-06-26 17:59:29
回答 1查看 101关注 0票数 0

我用的是电子反应样板。它通过克隆回购程序来指示安装:

代码语言:javascript
复制
git clone --depth 1 --single-branch https://github.com/electron-react-boilerplate/electron-react-boilerplate.git your-project-name

我希望能够修改这个本地git,并将它存储在我自己的存储库中。为此,我创建了一个新的存储库:

代码语言:javascript
复制
git remote add my_remote_repo https://github.com/paragbaxi/my_remote_repo

我在远程回购中存储的本地分支中跟踪这些更改。

代码语言:javascript
复制
git checkout -b local_branch
git commit -a -m 'Initial commit'
git push my_remote_repo local_branch

我如何从原点(电子反应-样板)中提取变化来安全地合并它们?

选项1:通过创建本地分支并进行合并?

  1. 创建本地分支

git结帐branch_to_pull_from_erb -b

  1. 合并

git合并原点

备选方案2:通过对原产地的拉动?

  1. 从erb拉出

git拉https://github.com/electron-react-boilerplate/electron-react-boilerplate.git

其他选择?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-26 19:43:57

你可以这样做:

git checkout -b some_remote_branchname

git pull origin some_remote_branchname

然后,您可以合并some_remote_branchnamelocal_branch

或者,如果要将远程分支拉到具有不同名称的本地brach中,可以按以下方式进行操作:

git pull origin some_remote_branchname:some_local_branchname

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62600428

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档