将远程分支拉到不同名称的本地回购站?(Pull remote branch into local repo with different name?)

编程入门 行业动态 更新时间:2024-10-12 01:28:12
将远程分支拉到不同名称的本地回购站?(Pull remote branch into local repo with different name?)

好的,我做了一点研究,但我找不到确切的答案,所以我不得不问。

我有2个遥控器:来源和repo2。

我想做一些类似的事情

git pull repo2 master

但这会把repo2的主分支拉到我的主人身上。 我可以为我的本地分行指定一个不同的分支吗?

Alright I did a little bit of research on this but I couldn't find an exact answer, so I have to ask.

I have 2 remotes: origin and repo2.

I'd like to do something like

git pull repo2 master

But this would pull the master branch of the repo2 into my master. Can I specify a different branch to pull into, for my local branch ?

最满意答案

git checkout -b myBranchName repo2/master git checkout -b myBranchName repo2/master

更多推荐

本文发布于:2023-08-05 21:09:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1437937.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:拉到   分支   名称   Pull   repo

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!