Reputation: 396
I have set up a git server using gitolite for a small team. One of us created a repo and pushed the initial commits using smart http - let's say it resides at
http://ourhost/project.git
I then proceeded to clone the project using ssh i.e.
git clone git@ourhost:project.git
Git let me do it and created the project folder but reported that the repo was empty. Furthermore any git pull I did gave me "couldn't find remote ref master" errors. When I then ran
git remote -v show origin
It showed HEAD branch: (unknown). When I checked on the server (runs gitlab) I could see the master branch and all the code so it was clearly there.
Finally I cloned it using smart http and lo and behold it all worked and I can get on with it.
But why is this? Why should it matter which method each of us use to push/pull? Gitlab even shows the two URLs (for ssh or smart http) as alternatives for repos so it seems to be expected to work...)
Or am I missing something...?
Upvotes: 5
Views: 537
Reputation: 1323953
With GitLab V4, and Gitolite, ssh remains the prefered method of access.
Https access could bypass completely Gitolite.
Since GitLab V5 doesn't use Gitolite anymore (but now uses gitlab-shell
instead), both ssh and https access can be used more consistently with the access right management.
Upvotes: 3