简体   繁体   English

git:如何从远程存储库中提取所有分支?

[英]git: how to pull ALL branched from remote repository?

I have a remote repository that has some branches that I don't have on my local repository. 我有一个远程存储库,其中包含一些本地存储库中没有的分支。 I want to import ALL branches from the remote repository to my local one. 我想将所有分支从远程存储库导入到我的本地存储库。 I tried to use "git pull" or "git fetch" and I stayed with the same branches I had before on my local repo. 我尝试使用“ git pull”或“ git fetch”,但我仍然使用本地仓库中以前的分支。 Do you know what can help me? 你知道有什么可以帮助我的吗?

git pull origin <remote-branch-name>

确保解决冲突(如果有),然后通过提交合并

git commit -m "pulled from brach-name"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM