访问git存储库的问题

时间:2015-01-28 23:57:23

标签: git ssh

  1. 我通过GitLab创建了一个'新项目'。
  2. 我确认“/var/opt/gitlab/git-data/repositories/root/test.git”存在,我甚至将其修改为777
  3. 我手动通过ssh登录(git@*****.net)并且工作正常,我可以通过ssh从家用计算机访问存储库文件。
  4. 但是当我从家里的电脑上做这件事时:

             git remote add origin git@*******.net:root/test.git 
             fatal: Not a git repository (or any of the parent directories)
    

    我也通过GitLab添加了SSH证书。

    当我尝试克隆项目时,我得到了同样的错误:

    C:\Program Files (x86)\Git\bin>git clone git@*******.net:root/test.git
    Cloning into 'test'...
    git@d*******.net's password:
    fatal: 'root/test.git' does not appear to be a git repository
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

    test.git:

     drwxrwx--- 7 git git 4096 Jan 28 15:55 ./
     drwxrwx--- 8 git git 4096 Jan 28 19:00 ../
    -rwxrwxrwx 1 git git   66 Jan 28 15:15 config*
    -rwxrwxrwx 1 git git   73 Jan 28 15:15 description*
     drwxrwxr-x 7 git git 4096 Jan 28 15:56 .git/
     -rwxrwxrwx 1 git git   23 Jan 28 15:15 HEAD*
     lrwxrwxrwx 1 git git   47 Jan 28 15:15 hooks 
     drwxrwxrwx 2 git git 4096 Jan 28 15:15 info/
     drwxrwxrwx 4 git git 4096 Jan 28 15:15 objects/
     drwxrwxrwx 4 git git 4096 Jan 28 15:15 refs/
    

1 个答案:

答案 0 :(得分:1)

您获得的错误可能是由于存储库未被引入。如果您正在使用github,最简单的方法是克隆您在1处创建的项目。另请参阅How do I clone a github project to run locally?

然后,您将能够配置遥控器并推送规格。

 git clone git://github.com/yourgithubusername/test.git
相关问题