gpt4 book ai didi

git - 我怎样才能 git clone 一个特定的版本?

转载 作者:行者123 更新时间:2023-12-04 14:47:47 24 4
gpt4 key购买 nike

好吧,我看到有人在谈论克隆 git 版本,但我不明白,我按照他们提供的教程进行操作。
How to git clone a specific release?
这是他们给出的教程命令。

$ git clone  git@github.com:mygitname/theproject.git --branch 1.0.2
这是我尝试过的一些命令。
~ $ git clone  git@github.com:discordjs/discord.js --branch 13.2.0
Cloning into 'discord.js'...
error: cannot run ssh: No such file or directory
fatal: unable to fork
~ $ git clone https://github.com/discordjs/discord.js/releases/tag/13.2.0
Cloning into '13.2.0'...
fatal: https://github.com/discordjs/discord.js/releases/tag/13.2.0/info/refs not valid: could not determine hash algorithm; is this a git repository?
~ $ git clone discordjs/discord.js --branch 13.2.0
fatal: repository 'discordjs/discord.js' does not exist
但是没有任何效果,有人可以帮助我吗?我会很感激的。

最佳答案

问题出在您尝试使用的 git 远程 url 上。
试试下面的,它会克隆特定的版本

git clone https://github.com/discordjs/discord.js.git --branch 13.2.0
您尝试使用的那些不起作用的原因:
// the remote url is an ssh url and you probably don't have ssh installed
git clone git@github.com:discordjs/discord.js --branch 13.2.0

//not valid git remote urls
git clone https://github.com/discordjs/discord.js/releases/tag/13.2.0
git clone discordjs/discord.js --branch 13.2.0

关于git - 我怎样才能 git clone 一个特定的版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69699204/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com