2
我想反映我的git仓库,所以我做了以下通过SSH:无法复制通过HTTP远程Git的镜子,但可以通过SSH
$ mkdir tvshowtracker.git
$ cd tvshowtracker.git
$ git init --bare
然后,在本地:
$ git remote add rolisoftdotnet ssh://[email protected]/repos/tvshowtracker.git
$ git push rolisoftdotnet master
现在,如果我想在其他地方复制我的仓库,它的工作原理,如果我这样做了SSH:
$ git clone ssh://[email protected]/repos/tvshowtracker.git
Cloning into tvshowtracker...
[email protected]'s password:
remote: Counting objects: 1423, done.
remote: Compressing objects: 100% (460/460), done.
remote: Total 1423 (delta 953), reused 1423 (delta 953)
Receiving objects: 100% (1423/1423), 2.08 MiB | 355 KiB/s, done.
Resolving deltas: 100% (953/953), done.
但是,如果我想这样做通过HTTP,它失败与此错误:
$ git clone http://lab.rolisoft.net/repos/tvshowtracker.git
Cloning into tvshowtracker...
warning: remote HEAD refers to nonexistent ref, unable to checkout.
我试着发布我在相关帖子中看到的每个命令,但没有任何帮助。
我刚开始玩git,所以我不知道90%的命令是做什么的,但是我试过了。
$ git push --all rolisoftdotnet
$ git branch -r
$ git branch master rolisoftdotnet/master
$ git checkout master
我希望HTTP访问的原因是为我的项目提供公共只读访问权限。
这工作!谢谢! – RoliSoft 2011-02-06 17:32:13