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

I started using git very recently and still havent setup a remote repository before, so I am totally lost.

This is my setup: I have a repository in my local machine, which I want to publish in our dedicated server (outside the local network). How do I setup a remote git repository in this server, with a security config and whatever else is necessary?

Edit: this would be a private repository, so only me and a few people can access it. I guess there are a lot of ways to go about this, so please explain the easiest solution that meets these requirements.

share|improve this question
1  
you may want to be more specific, there is several ways. Do you intend for people to anonymously access the repo with a URI like git@host:/project.git or just access for yourself via user or root account with a URI like root@host:/project.git or even over http (not sure if that is an option) –  Tim Dec 28 '11 at 18:34
    
Just me and two more people, so we would have to secure it. Please tell me if you need to know anything else –  ooops Dec 29 '11 at 13:22
add comment

3 Answers

up vote 2 down vote accepted

The way I do this is to first add a user 'git' to the remote server - then mkdir project.git, cd project.git and then initialize a bare repository with git init --bare then on the local machine: git remote add origin git@yourserver.com:project.git followed by: git push origin master hope that helps

share|improve this answer
add comment

An alternative is to use gitolite which provides access control on top of git. It will save you the headache of having to create and configure access for each user on the server. If like github then you can use gitlab (which uses gitolite) to manage your repos via the web. All in all they will both save you the headache of having to manage users server side. Hope this helps

share|improve this answer
add comment

I believe an answer has already been posted here that will help you, please look at Create SSH user with limited privileges to only use Git repository

share|improve this answer
add comment

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.