1

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.

3 Answers 3

6

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: //www.kernel.org/pub/software/scm/git/docs/git-daemon.html

3 - http: //git.or.cz/gitwiki/Gitweb

1
  • It's Windows Server 2008....But thanks for the tip! :-D
    – Goober
    Aug 27, 2009 at 13:02
2

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.

1
  • To avoid having complete shell access, use git-shell along with SSH as the user shell.
    – sybreon
    Aug 27, 2009 at 11:25
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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