Git does not require a special “server” to run. For example, if you are on a local network, you can just put the repository on a shared network drive. Git does not handle the security. You configure the read/write access on the folder. I’m not an expert in system administration so I’m going to suggest some options and provide links that I found helpful:

  • Ssh is you friend for security. If you do not want to provide shell access to everyone, you can setup one git user and use ssh keys to provide access. If you go that route, take a look at gitosis, which is a bunch of python scripts that automates part of administering that kind of setup. Gitosis gives you a git repository to configure access and projects. It’s very nice.
  • Another option is through http. You need webdav for that.
  • Git daemon comes with git and is perfect if you only need to quickly give public read access.
  • There are couple of git hosting site that are popping up. Check out and Github (invitation only for now but has a sexy look).

Popularity: 100% [?]


8 Responses to How To Set Up A Git Server

  1. Derek Mahar says:

    I think the “through http” link refers to the wrong location. It refers to the same article as “one git user and use ssh keys” which explains how to host a Git repository using SSH, not HTTP.

  2. Jean-Fran├žois, you didn’t mention Gitorious:”” in your hosting sites list. Gitorious has a nice look too, and I actually moved the “Piston”: repository there.

  3. jfcouture says:

    I just found out about gitorious a couple of days ago. New git hosts seem to be popping up left and right. If you find any other ones, please feel free to add to the comments.

  4. Derek Mahar says:

    Do any of the Git hosts other than allow you to delete your project or the project Git repo? I appreciate, but one of its drawbacks is that it doesn’t allow you to delete a project or your project Git repo in case you ever mess up your project Git repo and want to re-create it.

    Does Git allow a user to delete and re-create the master branch in a remote repository? This would solve the problem on that I mention above.

    • Hidayani says:

      Ollie Glad the guide is helpful!If you’re wroknig with other people, who are using Git exclusively, then you’ve got a whole host of other worries to deal with. From my understanding, when you rebase against the svn trunk, git-svn renames each commit to be in accordance with svn’s linear commit numbering. That means that when you commit a change with Git hash 12345, and then svn dcommit (or git rebase svn/trunk), the commit ID is changed to something else say 54321. If you push that change back up to Github (at least, if you force push it), you are effectively replacing your pure Git history. This is a problem for collaborators who are getting their information through Git, because commit 12345 (which they had already pulled) is in conflict with (because it is identical to) 54321.You can get around some of this by omitting the rebase flag from your git pull. Git merge will detect your conflicts and will usually do a pretty good job of wroknig around them automatically. However, you may find that there is still some funny business you might end up, for instance, with two versions of every commit (the Git version and the SVN version) in your commit logs.For your setup, you might consider using SVN in a slightly dumber way, where at release time you copy over your files from Git into a fresh svn checkout of your trunk, svn add any new stuff, and then just commit the changes. That’ll mean that your svn commit history will not be in sync with your Git history, but at least it means that you won’t have any problems with being out of sync with your collaborators. Let me know what you figure out I’m still learning as I go along with this stuff!

  5. jfcouture says:

    It depends on the kind of mess you created. Take a look at the git reset command. It can be used to completely destroy revisions. However, if that is on public repo, then it’s very dangerous. If other people cloned the repo and have commits based on the revision you destroyed, it’s going to be painful to recover from that.

  6. Robyn says:

    I see you share interesting stuff here, you can earn some extra cash, your
    blog has huge potential, for the monetizing method, just type in google
    - K2 advices how to monetize a website

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>