webSIGHTdesigns - Web Design, Web Development, Web Hosting

How to Set Up a Linux Git Server

Posted on Sunday, June 1st, 2014 at 10:20 pm
by webSIGHTdesigns

How to configure git on a Linux web server.

To set up a git server you will need two directories on your server, one for the repository files and another to make changes to your files in, known as your working files. Generally you will keep your working files in /var/www/domain.com/ and your repository files in /repo/domain.com/ but some operating systems may have a different file structure. If you don't already have a /repo/domain.com/ on your system, you'll need to create one:

$ mkdir -p /repo/domain.com/

Change into the domain directory in <code>/repo/</code> and create a bare repository:

$ cd /repo/domain.com/
$ git --bare init

Now change into your working files directory and clone this repository (it is currently still an empty repository):