Setting Up Git on a Workstation

Here’s how to setup git on a workstation.

But First …

Step by Step

First check to see if you might already have it.

git version

If you see the following you don’t have it.

Command 'git' not found, but can be installed with:

sudo apt install git

We’ll do what it says.

sudo apt install git

Type in your password when asked then y when prompted.

[sudo] password for rob:                                
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 100 not upgraded.
Need to get 3,907 kB of archives.
After this operation, 32.2 MB of additional disk space will be used.
Get:1 bionic-updates/main amd64 git amd64 1:2.17.1-1ubuntu0.4 [3,907 kB]
Fetched 3,907 kB in 1s (6,409 kB/s)
Selecting previously unselected package git.
(Reading database ... 403005 files and directories currently installed.)
Preparing to unpack .../git_1%3a2.17.1-1ubuntu0.4_amd64.deb ...
Unpacking git (1:2.17.1-1ubuntu0.4) ...
Setting up git (1:2.17.1-1ubuntu0.4) ...

You’re all set. You will need to create some keys and add some configuration but that depends on how you setup GitLab.