Run your own GIT server
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.
$ mkdir gittest
$ cd gittest
$ git init --bare
Initialized empty Git repository in /home/myname/git/gittest/
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://email@example.com:/home/myname/git/gittest
$ 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://firstname.lastname@example.org:/home/myname/git/gittest 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:
Common Git Commands
List remote branches
git branch -r
GIT client can work with remote Git or SVN repositories.
Download and Install SmartGit
Note: this is a limited-time commercial version.
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 https://git-scm.com/
Click Git-2.16.1-64-bit.exe to start installation
Follow https://www.tutorialspoint.com/angular2/angular2_environment.htm for choices
By default, git will installed at C:\Program Files\Git
GIT Lab CICD
Install GIT Runner on Linux
First, download one of below:
# Linux x86-64
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
# Linux x86
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-386
# Linux arm
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-arm
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:
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. https://gitlab.com/):
Please enter the gitlab-ci token for this runner:
Please enter the gitlab-ci description for this 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:
After your registration, you will see runner be displayed in GitLab console for your project.