Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i am a little bit lost with this issue, let me explain you my problem: I want to setup a git repository, three of four users will contribute, so they need to download the code and shall be able to upload their changes to the server or update their branch with the latest modifications.

So, i setup a linux machine, install git, setup the repository, then add the users in order to enable the acces throught ssh.

Now my question is, What's next?, the git documentation is a little bit confusing, i.e. when i try from a dummy user account to clone the repository i got:

xxx@xxx-desktop:~/Documentos/git/test$ git clone -v ssh://xxx@192.168.1.104/pub.git
Initialized empty Git repository in /home/xxx/Documentos/git/test/pub/.git/
xxx@192.168.1.104's password: 
fatal: '/pub.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

is that a problem of privileges? need any special configuration?

i want to avoid using git-daemon or gitosis, sorry, maybe my question sound silly but git is powerfull but i admit not so user friendly.

Thanks Br

share|improve this question

3 Answers 3

You should start with this error:

fatal: '/pub.git' does not appear to be a git repository

Git doesn't think this is a git repository.

So, it's very likely that the path to the repository is incorrect in the clone command.

Is the path to your repository on the server in the clone command correct?

According to your command, the repository is in the server's / (root) directory (e.g. /pub.git)

You need to specify the full path to the repository on the server.

If the repository is in a user's home directory then you'd have to include those directories in the command also:

$git clone -v ssh://xxx@192.168.1.104/~/pub.git

or

$git clone -v ssh://xxx@192.168.1.104/home/username/pub.git
share|improve this answer
    
yes, i am quite sure the path is fine, if i do the same with my own user (the one that orinally has created the repository) then cloning is woking fine... –  ignatius Mar 30 '10 at 20:20
    
thanks for your reply. But i guess the problem it is related with user accounts. now i follow another strategy, i have created git user, that will be shared by all integrators. then i created in the central repository one bare repos: git init --bare then i copy in this folder the ssh keys from the users (generated by ssh-keygen), and commit and modify files, then i push the modifications and seems that is working fine, but, i dont know if this is the best way to proceed.... –  ignatius Mar 30 '10 at 20:44
    
Seems a good way to me. This limits the security concerns to one user that has access to SSH. Also, unlike svn, git manages the user commits using the author specified by the actual author of the commit. FYI this is the same way that github.com does it. –  Josiah Mar 30 '10 at 21:04
    
ok. then i will go with that. by the way, i am worried about this bare repository, which are the differences between this kind of repository and the regular one?, i should take any special measure with this? thanks –  ignatius Mar 30 '10 at 21:17
    
The only difference is that a bare repository doesn't have a working directory. So, you can safely push to it. You wouldn't want to use a non-bare repository for a repository you're sharing. –  jmohr Mar 30 '10 at 21:24

gitosis-admin is the best way to get rolling with serving git, IMO. You install the software, setup a "git" user, put each user's SSH public key into the config file, and you're done.

share|improve this answer

Better even than gitosis is gitolite, which is newer and more flexible. I wrote a blog post about it not long ago: http://colonelpanic.net/2011/01/git-and-gitolite-nirvana/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.