Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

3 Answers 3

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:

http://fclose.com/b/linux/366/set-up-git-server-through-ssh-connection/

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

 
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.