简体   繁体   English

我可以从Gitlab存储库中的Github存储库导入分支吗?

[英]Can I import a branch from a Github repository in a Gitlab repository?

我认为一种方法是从Gitlab上的Github导入整个存储库,然后尝试将分支从此导入的存储库移至我的本机gitlab存储库。

The simplest way would be to create a sandbox with two remotes, and push the branch you want to the second remote: 最简单的方法是使用两个遥控器创建一个沙箱,然后将所需的分支推送到第二个遥控器:

git clone <github_url>
cd <repo_name>
git remote add gitlab <gitlab_url>
git push gitlab <branch_name>

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

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