The purpose of this post is to focus on the steps that are needed to set up and access a local GIT server.
I am taking the liberty to re-use the original description and screenshots from the original articles wherever applicable.

If you work for a big company, you don’t have to worry much. You will have Atlassian Stash or GitHub who will take care of the source control mechanism for you.
What if you are a sole developer in your company and you don’t want to spend a lot on the third party managed source control set up?

You set up your own GIT server. This post is about setting up a GIT server locally.
In our case, there are two developers with MacBook Pros and an extra iMac.
So we decided to set up GIT server in the extra iMac we had.

These were the steps we followed.

1. Add a GIT user account on Server machine.
2. Turn on the remote login for GIT user in Server machine.
3. Creating SSH keys in client machines
4. Adding up client’s public keys in Server
5. Making a bare repo on the server
6. Using the new GIT server!

Now the above steps in detail:

For the brevity of the post, assume that you are setting up the GIT server on an iMac.
Also, it is assumed that you have an account with admin access in this iMac.

1. Add a GIT user account on Server machine.

Login to the admin account in the iMac.
Open up System Preferences » Accounts and add a standard user

Log into the new git user account.
Open Terminal.app and type the following:

echo 'export PATH="$PATH:/usr/local/git/bin/"' >> ~/.bashrc

2.Turn on the remote login for GIT user in Server machine.

Log out of the git user, and log back into your administrator account.
Open up System Preferences » Sharing and turn on Remote Login (this is ssh).

Set Allow access for to Only these users and add the git user to the list.

3.Set up SSH on client machines

Open a terminal on your local computer and enter the following:

ssh-keygen -t rsa -C "your_email@example.com"

Associating the key with your email address helps you to identify the key later on.
You’ll see a response similar to this:

Just press <Enter> to accept the default location and file name. If the .ssh directory doesn’t exist, the system creates one for you.

Enter, and re-enter, a passphrase when prompted.
The whole interaction will look similar to this:

You are done.

4.Setting up client’s public keys in Server

You can use the below command to add the public key of the client machine added to the authorized_keys file on the server.
Log into the git user in the iMac
Run this command on the client machine:

If you have more client machines, repeat the above steps in all of them. You may see some prompts similar to the screenshot below in step 6. Select yes and proceed.

5.Making a bare repo on the server

This is the definition of a “bare” git repo: a repository that can never have files checked out. Everyone pulls and pushes from the server like normal, but nobody can actually work on the server (unless they make a non-bare clone).

If you are creating a new repository called “myrepo.git”, you can make it bare like so:
git init –bare myrepo.git

6.Using the new GIT server

In the client machine all you have to do is the usual clone.
eg: git clone ssh://iMacName/Users/git/myrepo
You may get a prompt like this on the client machine. Opt for YES and enter the password.

You should have the cloned copy in the local machine by this time.

Where to go from here?

In my case, the project was already there in my local machine. I wanted to have the project data centralized in the new git server.