0

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.

ooops
  • 191
  • 1
  • 3
  • 12
  • 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

3 Answers3

2

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

enkdr
  • 230
  • 2
  • 7
1

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

nkaronji
  • 21
  • 1
0

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

Tim
  • 3,017
  • 17
  • 15