Road to DevOps: Installing Git Server

by Akshay Ranganath
1002

Most people in DevOps won’t set up their own instance of Git. With so many enterprise products on the market today, many of which integrate easily with workflow tools, the roll-your-own approach is becoming rare.

However, there are usecases where installing your own Git server is useful, or even necessary. It’s also a good learning experience, and so before embarking on my DevOps journey, I wanted to setup a Git server and client.

I didn’t want to use the public Github, or any free service. I wanted to do it the hard way to ensure that I knew the process and could relate to the pain that ops feel in setting a new system up!

Installing Git as a Server

I started out by following the instructions from Git on the Server – Setting Up the Server. It’s an informative article, and well-referenced by others.

However, as with all things Linux, one of the steps didn’t work. When I followed the process and tried to push my code to the remote Git server, it failed. After a bit of research, I found out these are the steps that works.

It was basically one line that caused the problem: $ git init –bare myproject.git

Without this step, the git reference files were created a directory above the folder marked as repository. The code push would fail and I’d see only errors. Once I made this correction, the error went away and the I was able to continue using Git.

Tweaking and Checking Git Settings

After installing Git, here are some tips to check or update the git settings. The first set lists the current settings on Git and the rest of the commands is for tweaking the git settings.

Git settings are divided into three sections as follows:

  • System settings: applies to all users and all repositories.
  • Global settings: applies to this users for all the user’s repositories.
  • Local settings: applies to this repository.

System settings are overridden by Global; Global settings are over-ridden by Local.

Categories: DevOps How To, Technology

Suggested Article

LEAVE A REPLY