Installing Git On Linux Mint
Git has to be installed on the users computer to capacitate its use by the respective user.It can be either downloaded and installed directly or installed via the command line.
The detailed installation process below uses the _apt _command.It is recommended to update and upgrade your Ubuntu system before installing the Git package.
-
update the apt package listing:
**$ sudo apt update**
-
upgrade the system with the command:
**$ sudo apt upgrade**
-
After successfully updating and upgrading the Linux Mint system, install Git with the command:
**$ sudo apt install git**
Press ‘y’ to continue installing Git.
-
Verify the installation when the Git is successfully installed:
**$ git --version**
Configuring Git
The user needs to confirm if is already installed on their PC using a command that exposes the Git version installed:
**$ git --version**
The Git configuration can be executed from the command line. This refers to the process of setting a name and email address.The name and email are used while committing changes on the Git repository.
The following commands are used for configuration:
-
To set a global commit name:
**$ git config –global user.name <“Your Name”>**
-
To set the global commit email:
**$ git config –global user.email <“Your Email”>**
-
Run the following command to check and verify the changes after the global commit name and email are set:
**$ git config --list**
The data output verifys that the global commit name and email are sent successfully.
-
You can review what is currently stored in the .gitconfig file by using the cat command:
**$ cat ~/.gitconfig**
-
You can edit the configuration settings any time if you want to change the global commit name and email or when the changes were not made correctly using the following command:
**$ sudo nano ~/.gitconfig**
Any changes can be made in Git configuration file once it is opened in the nano editor.
-
This information can be stored for quicker access in the future using the following
command:**$ git config --global credential.helper cache** This is for dedicated servers being run by 1 or 2 people that are trustworthy as the information isn’t stored securely and any user with access to the server can read it.
User are advised to cache only for a limited time for increased security, that is, if
they must use credential helper.
i.e Lets assume you are going to be working today using Git for 1-2 HOURS and won't be using it there after. The expiry can be set to 3 hours.
$ git config --global credential.helper "cache --timeout=10800"
This secures your Git as credentials will be deleted immediately after 3 HOURS.
Top comments (0)