{"id":13911,"date":"2022-01-14T09:28:18","date_gmt":"2022-01-14T09:28:18","guid":{"rendered":"https:\/\/linuxways.net\/?p=13911"},"modified":"2022-01-31T09:52:44","modified_gmt":"2022-01-31T09:52:44","slug":"how-to-install-and-configure-git-on-linux-mint-20","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/mint\/how-to-install-and-configure-git-on-linux-mint-20\/","title":{"rendered":"How to Install and Configure Git on Linux Mint 20"},"content":{"rendered":"<p><a href=\"https:\/\/git-scm.com\/\">Git<\/a> is a free and open-source distributed version control system created to manage everything from small to massive projects with speed and efficiency. It is a software that is designed to keep track of changes in files, usually used for work collaborations among programmers developing source code during software development.<\/p>\n<p>In this document, we will learn how to install Git on our system with the help of a few easy-to-follow commands. We have used Linux Mint distribution for this purpose. We will also see how to configure git so that it can interact with <a href=\"https:\/\/about.gitlab.com\/\">GitLab<\/a>. GitLab is an open-source <a href=\"https:\/\/en.wikipedia.org\/wiki\/DevOps\">DevOps<\/a> platform that allows the user to develop, secure, and operate software in a single application.<\/p>\n<p>Let\u2019s begin the process!<\/p>\n<h2>Installation Guide<\/h2>\n<h3>Step 1: Update and upgrade the existing packages<\/h3>\n<p>We will start with updating and upgrading the packages that already exist on our system.<\/p>\n<p>To update the packages, run this command with sudo:<\/p>\n<pre>sudo apt update<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"140\" height=\"16\" class=\"wp-image-13912\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-273.png\" \/><\/p>\n<p>After this, all the packages will be updated. However, they still need to be upgraded. To do that, run the upgrade command with sudo as shown below:<\/p>\n<pre>sudo apt upgrade<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"140\" height=\"19\" class=\"wp-image-13913\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-274.png\" \/><\/p>\n<p>This is how the terminal screen will appear after running the command:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"947\" height=\"1036\" class=\"wp-image-13914\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-275.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-275.png 947w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-275-274x300.png 274w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-275-936x1024.png 936w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-275-768x840.png 768w\" sizes=\"auto, (max-width: 947px) 100vw, 947px\" \/><\/p>\n<h3>Step 2: Install Git<\/h3>\n<p>Once all the packages are successfully upgraded, we will run a command to install Git.<\/p>\n<p>This command will install Git:<\/p>\n<pre>sudo apt install git<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"171\" height=\"22\" class=\"wp-image-13915\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-276.png\" \/><\/p>\n<p>After running the command, you will be informed that how much additional disk space will be used. It will use 38.4 MB of space. Type Y and hit enter to continue the installation process.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"549\" height=\"36\" class=\"wp-image-13916\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-277.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-277.png 549w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-277-300x20.png 300w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" \/><\/p>\n<h3>Step 3: Verify installation<\/h3>\n<p>After the installation is completed, you need to check if git is now installed on your system or not. Run the git version command to verify if git exists. This will also tell you the version number of the git you just installed on your system.<\/p>\n<pre>git --version<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"224\" height=\"34\" class=\"wp-image-13917\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-278.png\" \/><\/p>\n<p>If you don\u2019t see the above output, it means the installation didn\u2019t happen properly. Try to reinstall it following the previous steps. Also, make sure your internet connection is fine before you try installing it again.<\/p>\n<h2>Configuration Guide<\/h2>\n<p>Now that we have verified that Git software exists on our system, let\u2019s now configure it. We will do it using the terminal.<\/p>\n<h3>Step 1: Set Global Username<\/h3>\n<p>Following the command syntax mentioned below, set a username that will be needed while committing changes on the Git repository.<\/p>\n<pre>git config --global user.name \"Your name\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"459\" height=\"21\" class=\"wp-image-13918\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-279.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-279.png 459w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-279-300x14.png 300w\" sizes=\"auto, (max-width: 459px) 100vw, 459px\" \/><\/p>\n<h3>Step 2: Set Global User Email<\/h3>\n<p>Next, set the user email that will also be required to commit changes on the Git repository. To do that, use this command syntax:<\/p>\n<pre>git config --global user.email \u201cYour Email\u201d<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14605 size-medium\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/Screenshot-from-2022-01-30-13-57-05-300x15.png\" alt=\"\" width=\"300\" height=\"15\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/Screenshot-from-2022-01-30-13-57-05-300x15.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/Screenshot-from-2022-01-30-13-57-05.png 497w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3>Step 3: Verify username and email<\/h3>\n<p>When you will run the command mentioned below, it will show you the username and email that you just set in the previous steps. Check carefully.<\/p>\n<pre>git config --list<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"141\" height=\"24\" class=\"wp-image-13920\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-281.png\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"262\" height=\"37\" class=\"wp-image-13921\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-282.png\" \/><\/p>\n<p>In case you find an error like a spelling mistake or something else, you can correct it by editing the git configuration file.<\/p>\n<p>To do that run the command below. We have used a nano editor to open the file. Once the file is open, correct the mistake and save the file.<\/p>\n<pre>sudo nano ~\/.gitconfig<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"187\" height=\"27\" class=\"wp-image-13922\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-283.png\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"958\" height=\"354\" class=\"wp-image-13923\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-284.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-284.png 958w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-284-300x111.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-284-768x284.png 768w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\" \/><\/p>\n<p>In this guide, you saw how straightforward is the installation process for Git on Linux Mint 20. The installation will take around less than 15 minutes. After this, you will be able to use git to push and pull your projects to GitLab or do whatever you like.<\/p>\n<p>To see how you can configure and use Git on Debian, visit:<\/p>\n<p><a href=\"https:\/\/linuxways.net\/de\/debian\/how-to-configure-and-use-git-on-debian\/\">https:\/\/linuxways.net\/debian\/how-to-configure-and-use-git-on-debian\/<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Git is a free and open-source distributed version control system created to manage everything from small to massive projects with speed and efficiency. It is a software that&hellip;<\/p>","protected":false},"author":1,"featured_media":13971,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[475,129],"class_list":["post-13911","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mint","tag-git","tag-linux-mint-20"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=13911"}],"version-history":[{"count":1,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13911\/revisions"}],"predecessor-version":[{"id":14604,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13911\/revisions\/14604"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/13971"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=13911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=13911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=13911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}