GIT server with username and password authentication

gitgitolite

I would like to set a GIT server and let my developers to login using username and password in order to commit and make changes to the projects. I need also to manage developer access to projects (I think I should use gitolite for this).

How can I do that?

I am used to SVN which is easy because you can set username and password for each developer, which can easily access the repository without having the generate an ssh key and put it on the server.

Thanks

Best Answer

Perhaps you aren't aware of this, but Git is a distributed VCS. Thats essential to your understanding. OTOH SVN and CVS are centralized. You can still have a central repository in Git, and if you do, your users will need to be able to log into that server using SSH or HTTP access, look it up. Generally speaking, Git depends on the server's authentication.

So to make a git repo on a Debian or Ubuntu server for centralized use:

# apt-get install git
# cd /var/git
# git init --bare myreponame.git
# adduser <username>    as needed

At this point you have an empty repo. To clone it to your desktop Debian or Ubuntu:

For SSH connections: look up ssh keygen and set up a passwordless connection to your server- keygen and sharing is only two commands.

To clone a repo:

$ git clone <server>:/var/git/myreponame.git

$ cd myreponame

Now you can add files and directories... when you have used git add and git commit, then you can use git push to push commits to the central repo.

  • There are non-bare repositories, you must read up on this, use the standard Git references, just Google.
  • Warning a "shared repository" is not what you think from the name.