• 2013-09-28

    解决从github匿名获取只读repo错误

    Views: 25835 | No Comments

    如果想从 github 上匿名获取某个 repo, 一般都会直接到该 repo 的网页复制网页中给的 HTTPS URL. 但是, 不知道 github 抽风还是怎么了, 获取总是报错:

    $ git clone https://github.com/ideawu/ssdb.git
    Initialized empty Git repository in /xxx/.git/
    Cannot get remote repository information.
    Perhaps git-update-server-info needs to be run there?
    

    只好尝试使用 SSH 方式(非 github 登录用户看不到 SSH 方式的 URL):

    $ git clone git@github.com:xxx/ssdb.git
    Initialized empty Git repository in /xxx/ssdb/.git/
    Permission denied (publickey).
    fatal: The remote end hung up unexpectedly
    fetch-pack from 'git@github.com:xxx/ssdb.git' failed.
    

    显然, 这需要输入账号和密码. 我记得 github 改版之前, 是提供了 Read-only URL 的, 不知道为什么改版之后就不提供了?! 不过, 你还是可以手工拼出只读 SSH:

    git clone git://github.com/ideawu/ssdb.git
    

    把项目的网址中的"https://"替换成"git://", 然后在末尾加上".git".

    Posted by ideawu at 2013-09-28 17:03:56 Tags:
|<<<1>>>| 1/1 Pages, 1 Results.