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

问题描述 投票:0回答:1

我尝试使用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中使用这一行

git clone https://github.com/litecoin-project/litecoin.git
git tag -l
git checkout 0.8

# git clone --branch 0.8 [email protected]:litecoin-project/litecoin.git
# git clone -b 0.8 https://github.com/litecoin-project/litecoin.git

错误我的电脑中没有litecoin文件夹,但让我显示:

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
git shell github
1个回答
1
投票

第一个错误

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

是因为你需要先cd成litecoin文件夹。

git clone https://github.com/litecoin-project/litecoin
cd litecoin
git tag -l
git checkout 0.8

对我来说很好

© www.soinside.com 2019 - 2024. All rights reserved.