首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用.sh (shell)克隆带有特定标记的github项目

使用.sh (shell)克隆带有特定标记的github项目
EN

Stack Overflow用户
提问于 2018-03-26 16:33:03
回答 1查看 387关注 0票数 0

我试图使用shell .sh克隆带有特定标记的github项目,但没有成功。

在这种情况下,我想下载这个版本:https://github.com/litecoin-project/litecoin/releases/tag/v0.8.0

有趣的部分是litecoin路径不存在,如果只使用:git clone -b 0.8 https://github.com/litecoin-project/litecoin.git

我可以克隆这个项目。

我在我的.sh中使用了这一行

代码语言:javascript
复制
git clone https://github.com/litecoin-project/litecoin.git
git tag -l
git checkout 0.8

# git clone --branch 0.8 git@github.com:litecoin-project/litecoin.git
# git clone -b 0.8 https://github.com/litecoin-project/litecoin.git

错误:我的pc中没有litecoin文件夹,但一直显示如下:

代码语言:javascript
复制
fatal: destination path 'litecoin' already exists and is not an empty directory.
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-03-26 16:42:01

第一误差

代码语言:javascript
复制
fatal: destination path 'litecoin' already exists and is not an empty directory 

如果您尝试克隆而不删除已经存在的文件夹,则会发生。

错误

代码语言:javascript
复制
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git

是因为你需要先把cd放进litecoin文件夹。

代码语言:javascript
复制
git clone https://github.com/litecoin-project/litecoin
cd litecoin
git tag -l
git checkout 0.8

对我来说很好

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49496363

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档