Git version control with multiple users

5,342

Solution 1

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://[email protected]/~/pub.git

or

$git clone -v ssh://[email protected]/home/username/pub.git

Solution 2

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:
5,342
Tom De Gussem
Author by

Tom De Gussem

Updated on September 17, 2022

Comments

  • Tom De Gussem
    Tom De Gussem over 1 year

    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://[email protected]/pub.git
    Initialized empty Git repository in /home/xxx/Documentos/git/test/pub/.git/
    [email protected]'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

  • Tom De Gussem
    Tom De Gussem about 14 years
    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...
  • Tom De Gussem
    Tom De Gussem about 14 years
    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....
  • Tom De Gussem
    Tom De Gussem about 14 years
    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
  • jmohr
    jmohr about 14 years
    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.