git clone repo A到新的repo B,同时仍从repo A获取更新

帕拉巴克西

我正在使用电子反应样板。它通过克隆仓库来指示安装:

git clone --depth 1 --single-branch https://github.com/electron-react-boilerplate/electron-react-boilerplate.git your-project-name

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

git remote add my_remote_repo https://github.com/paragbaxi/my_remote_repo

我在远程仓库中存储的本地分支中跟踪这些更改

git checkout -b local_branch
git commit -a -m 'Initial commit'
git push my_remote_repo local_branch

如何从原点(电子反应样板)提取更改以安全地合并它们?

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

  1. 创建本地分支

     git checkout -b branch_to_pull_from_erb
    
  2. 合并

     git merge origin
    

选项2:反对起源吗?

  1. 从erb拉

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

还有其他选择吗?

达利

您可以这样做:

git checkout -b some_remote_branchname

git pull origin some_remote_branchname

然后,您可以合并some_remote_branchnamelocal_branch

或者,如果要将远程分支拉入具有不同名称的本地分支中,则可以这样拉:

git pull origin some_remote_branchname:some_local_branchname

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章