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 (手动解决冲突)

原文地址:https://www.cnblogs.com/yuxiaoyiyou/p/15494253.html