Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up GIT on my home CentOS 6.2 server (I already have LAMP running on it). The only access that will be made to it is from the local network - or to be more precise, from my laptop running Fedora 16. Unfortunately I'm not able to find a good "HowTo" to do this.

I installed it on the server but what is next? What modification do I need to apply to it? How do I connect to it and use it with, for example, NetBeansIDE which I use for PHP.

Any hints or "HowTo" is welcome.

share|improve this question
up vote 5 down vote accepted

On the server:

$ cd /path/to/directory/
$ git init
$ git add .
$ git commit -m 'Initial commit'

That sets up the basic repo and adds all the files in /path/to/directory into there.

On the laptop:

$ git clone username@server:/path/to/directory/

git will connect over ssh to retrieve and clone the repo.

At this point, you can makes changes, commit them, and do git push and it will push the new commits over ssh to the repo.

Since you've described a simple setup of just you and no one else, working over ssh should be fine. You don't need to set up a git daemon.

There's some more info here:

Actually, there should be plenty of git tutorials if you look around.

share|improve this answer

It sounds like you've already installed Git, the version control system, and want to add a way to serve your Git repositories so you can access them from other machines.

If you want Git to serve a repository just occasionally, i.e. for pushing and pulling between people you know on your local network, you could have a look at the answers in this question. It explains commands like git daemon or git instaweb. It is very basic, and not as fancy as Mercurial's built-in hg serve.

However, that becomes annoying quickly as your get multiple repos, more people need to access your repos, and you want security and an easier way to manage read or write access for these contributors. Gitolite helps you set up a central Git server, serve multiple repositories at once and provides ways to control who gets to access to which branch, tag, etc. Lots of features.

Another popular option, which is less feature-rich than Gitolite, is Gitosis.

share|improve this answer

If you are asking how to share your Git repository, here's a nice writeup of the options you have:

If you are also asking how to work with Git and how Git works for that matter, here's a list of tutorials:

I particularly like this one given it's organization (beginner, intermediate, advanced):

share|improve this answer

Your Answer


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.