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.

link|improve this question

80% accept rate
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
feedback

2 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

link|improve this answer
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.