如何使用GitLab克隆git存储库

如何使用GitLab克隆git存储库,git,bash,ssh,gitlab,Git,Bash,Ssh,Gitlab,我们的团队在gitlab上有一个git存储库。我在那里有一个帐户。我已经在一台计算机上创建了ssh密钥。现在我想把那个回购复制到另一台机器上。在我的帐户中,我可以在“SSH密钥”部分看到我的公钥,也可以在“帐户”部分看到我的私有令牌。起初我想在smartgit中使用现有密钥,但它不起作用,然后我创建了新密钥,将新公钥添加到我的帐户中,并尝试像这样从git bash克隆: git clone git@gitl.website.com:bla/bla.git 但它给了我 Cloning into

我们的团队在gitlab上有一个git存储库。我在那里有一个帐户。我已经在一台计算机上创建了ssh密钥。现在我想把那个回购复制到另一台机器上。在我的帐户中,我可以在“SSH密钥”部分看到我的公钥,也可以在“帐户”部分看到我的私有令牌。起初我想在smartgit中使用现有密钥,但它不起作用,然后我创建了新密钥,将新公钥添加到我的帐户中,并尝试像这样从git bash克隆:

git clone  git@gitl.website.com:bla/bla.git
但它给了我

Cloning into 'bla'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
我甚至尝试将公钥从我的GitLab帐户直接复制到 id_rsa.pub文件

那么我如何才能克隆存储库呢

已编辑

ssh-vvv的最后几行git@gitl.website.com

debug3: send packet: type 5
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /c/Users/Arthur/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Trying private key: /c/Users/Arthur/.ssh/id_dsa
debug3: no such identity: /c/Users/Arthur/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /c/Users/Arthur/.ssh/id_ecdsa
debug3: no such identity: /c/Users/Arthur/.ssh/id_ecdsa: No such file or directo                     ry
debug1: Trying private key: /c/Users/Arthur/.ssh/id_ed25519
debug3: no such identity: /c/Users/Arthur/.ssh/id_ed25519: No such file or direc                     tory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).

改过自新。创建一个新密钥并对其进行操作

  • 通过跑步,
    ssh-keygen
    并为其提供一个密钥名

  • 复制
    keyname.pub
    并将密钥粘贴到gitlab帐户中

  • 清除系统中已存在的任何剩余密钥,
    ssh add-D

  • 添加刚才通过
    ssh Add/keyname


  • 现在,再试一次git命令。

    改过自新。创建一个新密钥并对其进行操作

  • 通过跑步,
    ssh-keygen
    并为其提供一个密钥名

  • 复制
    keyname.pub
    并将密钥粘贴到gitlab帐户中

  • 清除系统中已存在的任何剩余密钥,
    ssh add-D

  • 添加刚才通过
    ssh Add/keyname


  • 现在,请重试git命令。

    “我甚至尝试将公钥从我的GitLab帐户直接复制到id_rsa.pub文件。”。那是个很坏的主意。反过来做。在您的计算机上,您需要私钥。从
    ssh-vvv发布日志git@gitl.website.com
    Git bash可能没有将私钥添加到您的SSH代理中,并使用日志发送帖子。那么如何手动添加它呢?“我甚至尝试将公钥从我的GitLab帐户直接复制到id_rsa.pub文件中。”。那是个很坏的主意。反过来做。在您的计算机上,您需要私钥。从
    ssh-vvv发布日志git@gitl.website.com
    Git bash可能没有将私钥添加到您的SSH代理中,并使用日志发送帖子。那么我如何手动添加它呢?