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 am using Git as my method of managing source control. Currently I am just using Git on my local machine with a local repository. I have a networked server setup which I would like to configure a repository on. Essentially I want to be able to push to the networked server, thus cutting out the need to use GitHub.

Someone has mentioned that the use of a daemon will be needed so that i can essentially tell Git to push to a repository at an arbitrary URL, for example "MyServer:8443/GitRepository/".

Unfortunately, I am completely lost on how exactly I go about doing this and would greatly appreciate some help.

share|improve this question

What OS is your server? It's a lot easier with a linux server.

You can do it as follows (presuming you already have ssh access). I shall call your server sally, and your desktop dan, for convenience.

Connect to your server from your desktop:

ssh sally

then on the server, create somewhere to keep your repos:

mkdir -p /var/git
cd /var/git

Now you have somewhere to keep stuff. Next we will presume you already have a git repo for your project called 'project1.git' on your desktop. You can do the following for each new project:

Still on the server

mkdir project1.git
cd project1.git
git --bare init   #use bare as you don't need the files checked out on the server
touch git-daemon-export-ok   #for later if you set up the git daemon (optional)

Then back on the desktop, push your changes to the new repo on the server:

git remote add origin sally:/var/git/project1.git
git push origin master

That's it. You can then clone from another machine with

git clone sally:/var/git/project1.git project1.git

Optional extras:

  • Set up the [git daemon][2], to share without needing ssh access.
  • Set up [gitweb][3] to get a nice web interface

2 - http: //

3 - http: //

share|improve this answer
It's Windows Server 2008....But thanks for the tip! :-D – Goober Aug 27 '09 at 13:02

Just push through SSH; setup your remote as MyServer:/path/to/gitrepo and away you go. If you want to provide read-only access to the Internet at large, you can either use HTTP, or git-daemon to support git:// protocol URLs.

share|improve this answer
To avoid having complete shell access, use git-shell along with SSH as the user shell. – sybreon Aug 27 '09 at 11:25

I found this link to be the most helpful : Intall Git on Windows Server 2008

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.