Menu Search Me


Created by info on 2019-07-15

Run your own GIT server

GIT Reference

Download and build GIT on Linux

$ tar -zxf git-2.0.0.tar.gz

$ cd git-2.9.5

$ make configure

$ ./configure --prefix=/usr

$ make all doc info

$ sudo make install install-doc install-html install-info

Note: if you do not need Documentation, in above, you can just do:

$ make all

$ sudo make install

Download GIT windows client

Setting up your git server and client

Let's run through the following scenario: 1) you have a mac client machine 1 which has your java project called "gittest". 2)  you have a windows client machine 2 which you want to have a clone of your java project called "gittest". 3) you have a linux server which you want the 2 clients to push the project and subsequent updates to. Here is what you need to do to set it up.

NOTE: you need to make sure your 3 machines are on the same time clock.

Server settup

$ pwd


$ mkdir gittest

$ cd gittest

$ git init --bare

Initialized empty Git repository in /home/myname/git/gittest/

$ ls

branches  config  description  HEAD  hooks  info  objects  refs


Mac client machine 1 setup

$ cd gittest

$ git init

$ git add .

$ git commit -m "message" -a

$ git remote add origin ssh://myname@     

$ git push origin master

The above will push your "gittest" java project from mac client machine 1 to your linux server.

Windows client machine 2 setup

On the windows client machine 2, you only need to clone the project from the server. 

Suppose you already have an existing git project on the server called "gittest" under /home/myname/git/, you can do the following to clone it to your client under ./gittest folder:
$ git clone -v ssh://ec2-user@ gittest

Add, Commit, Push, Pull

From now on, anytime you make any change to your project, do the following:

git add .

git commit -m "my change" -a

git push (or git push origin master)

Anytime you want to pull updates from the server, do the following:

git pull

Common Git Commands

List remote branches

git branch -r



GIT Client


GIT client can work with remote Git or SVN repositories.

Download and Install SmartGit

Note: this is a limited-time commercial version.

To download:

To start: .\SmartGit\bin\smartgit64.exe

Clone a remote repository

Repository -> Clone -> Remote Git or SVN repository

Enter the URL for the location of the remote repository

Download and Install SCM GIT

Download the latest version from
Click Git-2.16.1-64-bit.exe to start installation
Follow for choices
By default, git will installed at C:\Program Files\Git 


Install GIT Runner on Linux


First, download one of below:

# Linux x86-64
sudo wget -O /usr/local/bin/gitlab-runner

# Linux x86
sudo wget -O /usr/local/bin/gitlab-runner

# Linux arm
sudo wget -O /usr/local/bin/gitlab-runner

Second, give it permissions to execute:

sudo chmod +x /usr/local/bin/gitlab-runner

Third, Create a GitLab CI user:

sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash

Fourth, install and run as service:

sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner

Fifth, start it and check its running status:
sudo gitlab-runner start

sudo /sbin/service gitlab-runner status

You can also check gitlab-runner status by running the following command:

gitlab-runner verify

Runtime platform arch=amd64 os=linux pid=3504 revision=8bb608ff version=11.7.0
Starting multi-runner from /etc/gitlab-runner/config.toml ... builds=0
Running in system-mode.

Configuration loaded builds=0
Listen address not defined, metrics server disabled builds=0
Listen address not defined, session server disabled builds=0

Register GIT Runner with your GitLab project


# gitlab-runner register
Runtime platform arch=amd64 os=linux pid=3067 revision=8bb608ff version=11.7.0
Running in system-mode.

Please enter the gitlab-ci coordinator URL (e.g.
Please enter the gitlab-ci token for this runner:
Please enter the gitlab-ci description for this runner:
[]: MiMMS-PAL-Runner
Please enter the gitlab-ci tags for this runner (comma separated):
Registering runner... succeeded runner=xWDFDcFE
Please enter the executor: docker+machine, kubernetes, docker-ssh, shell, virtualbox, docker-ssh+machine, docker, parallels, ssh:
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

You can get the URL and token information from your GitLab project's GitLab project's Settings -> CI/CD -> Runners settings -> Specific Runners -> Setup a specific Runner manually

In your CI/CD .gitlab-ci.yml file, you need to specify the same tag that you provided above:

- mimms-pal-tag

After your registration, you will see runner be displayed in GitLab console for your project.