gpt4 book ai didi

git - 使用ssh克隆Git仓库

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

我正在尝试通过ssh在Mac上克隆git存储库。
到目前为止,我已执行的步骤

  • 创建了id_rsa.pub并与管理员共享以进行访问。该文件位于/Users/admin/.ssh
  • config处创建了一个/Users/admin/.ssh文件。文件内容是
    Host MY_DOMAIN
    IdentityFile ~/.ssh/id_rsa
    IdentitiesOnly yes
  • 我在终端上运行以下命令
    git clone git@MY_DOMAIN:android.git     
    git clone git@MY_DOMAIN:android

  • 我得到的回应是
    Cloning into 'android'...
    Enter passphrase for key '/Users/admin/.ssh/id_rsa':
    Connection to MY_DOMAIN closed by remote host.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

    如果我遵循正确的方法或访问权限有任何问题,我会感到困惑。

    最佳答案

    您自己的用户帐户应遵循前两个步骤,而不是/Users/admin

    根据您最近的编辑,看来问题不在于git配置,而在于您的gitolite设置。当前,您的gitolite实例仅允许您访问一个存储库,即testing,可从以下输出中清楚地看到:

    hello onkar, this is git@m running gitolite3 v3.6.2-12-g1c61d57 on git 2.1.4

    R W testing

    配置您的gitolite-admin存储库,并允许访问 android项目。

    关于git - 使用ssh克隆Git仓库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41178368/

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