【问题标题】:How can I git clone an specific release?如何 git 克隆特定版本?
【发布时间】:2021-12-10 09:59:08
【问题描述】:

好吧,我看到有人在谈论克隆 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 github release


    【解决方案1】:

    问题在于您尝试使用的 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 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-03
      • 1970-01-01
      • 1970-01-01
      • 2013-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多