微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

fork代码指定版本到自己的Gitlab中

1.gitlab上新建仓库

2.创建好master分支

3.cd到对应的目录,切换到对应的分支,下面以 twitter-text 这个库为例:

git remote add twitter-text https://github.com/twitter/twitter-text.git

(如果要删除的指令为 git remote remove twitter-text)

git fetch twitter-text (获取所有的branch和tag)

git pull twitter-text v2.0.3 (指定v2.0.3这个Tag引入twitter-text)

如果上面的指令失败 fatal: refusing to merge unrelated histories,则使用指令 --allow-unrelated-histories 可以强制pull:

git pull twitter-text v2.0.3 --allow-unrelated-histories (手动解决冲突)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐