How to install Git Repository on Linux Mint 18.3

To install Git Repository on Linux Mint 18.3

Git is an open source and most popular Version Control System. When a developer develops software he or she can store the software with its source code in Git repository. You can create a duplicate copy of the stored software to make changes to source code over time. The advantage of Git repository is, even if you make a mistake on source code while editing, it will not affect your live software and you can fix the mistake by comparing it with previously released source code. This tutorial covers the method to install Git Repository on Linux Mint 18.3. 

 

Installing Git Repository

Before you begin the installation process, make sure you update your repository by making use of the following command.

linuxhelp user # apt-get update
Hit:1 http://archive.canonical.com/ubuntu xenial InRelease
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease                                        
Ign:3 http://packages.linuxmint.com sylvia InRelease                                           
.
.
Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [589 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [546 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [238 kB]
Fetched 1,680 kB in 3s (438 kB/s)    
Reading package lists... Done

 

 

Once it’ s done, you shall add the necessary repository by making use of the following command.

linuxhelp user # add-apt-repository ppa:git-core/ppa
You are about to add the following PPA:
 The most current stable version of Git for Ubuntu.

For release candidates, go to https://launchpad.net/~git-core/+archive/candidate .
 More info: https://launchpad.net/~git-core/+archive/ubuntu/ppa
Press Enter to continue or Ctrl+C to cancel

Executing: /tmp/tmp.4V4Pnlceyy/gpg.1.sh --keyserver
hkp://keyserver.ubuntu.com:80
--recv-keys
E1DF1F24
gpg: requesting key E1DF1F24 from hkp server keyserver.ubuntu.com
gpg: key E1DF1F24: public key " Launchpad PPA for Ubuntu Git Maintainers"  imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

 

After that, you need to update the system again.

linuxhelp user # apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://archive.canonical.com/ubuntu xenial InRelease                                                        
Hit:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease                                                   
.
.
Get:11 http://ppa.launchpad.net/git-core/ppa/ubuntu xenial/main amd64 Packages [3,296 B]
Get:12 http://ppa.launchpad.net/git-core/ppa/ubuntu xenial/main i386 Packages [3,304 B]
Get:13 http://ppa.launchpad.net/git-core/ppa/ubuntu xenial/main Translation-en [2,604 B]
Fetched 27.8 kB in 2s (12.6 kB/s) 
Reading package lists... Done

 

Once it is done, you need to install Git by making use of the following command.

linuxhelp user # apt-get install git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  git-man libpcre2-8-0
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:
.
.
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Setting up libpcre2-8-0:amd64 (10.21-1) ...
Setting up git-man (1:2.16.1-0ppa1~ubuntu16.04.1) ...
Setting up git (1:2.16.1-0ppa1~ubuntu16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...

 

Once the installation is completed, you need to confirm installation by making use of the following command.

linuxhelp user # dpkg -l git
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                   Version          Architecture     Description
+++-======================-================-================-==================================================
ii  git                    1:2.16.1-0ppa1~u amd64            fast, scalable, distributed revision control syste


Now, you need to configure set-up of the Git repository which you can accomplish with the help of the following command.

linuxhelp user # git config --global user.name " linuxhelp1" 
linuxhelp user # git config --global user.email " support@linuxhelp.com" 

 

 

Later, you need to configure your global username of the Git repository.

linuxhelp user # git config --list

 

You need to add the username.

user.name=linuxhelp1
user.email=support@linuxhelp.com

 

Now open git configuration file.

linuxhelp user # vim ~/.gitconfig


You can see that the Git configuration is done.

[..]
[user]
        name = linuxhelp1
        email = support@linuxhelp.com
[..]

With this, the method to install Git repository on Linux Mint comes to an end. 
 

Tag : Linux Mint Git
Comment
dannypy
Mar 21 2018
This was a truly the article that I needed for git installation! Thanks! Keep up the great work! Now, in the part that goes: "Later, you need to configure your global username of the Git repository.", you omitted double dash in "-list" If you type it like that it'll produce an error so instead it should read "--list". Otherwise, pure gold for us rookies! Cheers!
Add a comment
FAQ
Q
how to install git on centos?
A
just follow this link, https://www.linuxhelp.com/how-to-install-git-in-centos/
Q
I want to install git on Ubuntu?
A
use this link https://www.linuxhelp.com/install-git-ubuntu/
Q
please share the link for debian?
A
refer the following link, https://www.linuxhelp.com/how-to-install-git-on-debian-8-6/
Q
how to I can reset my gitlab admin password?
A
please follow this for resetting gitlab admin password, https://www.linuxhelp.com/how-to-reset-admin-password-in-gitlab/
Q
where the git project exported will store?
A
you can find in this location /var/opt/gitlab/gitlab-rails/shared/tmp/project_exports/