How to Install Git on Linux and Windows
In the first part of the Learn Git tutorial series, we already know what Git is and get to know briefly about Version Control System (VCS).
Before learning to use Git as a version controller in your app development process, you must first have Git on your device. In this section we will learn how to install Git on both Windows and Linux operating systems.
If you already have Git before, you can skip this part of the tutorial and move on to the next part of the tutorial.
How to Install Git on Linux
If you’re using a Linux distribution, usually Git is pre-installed defaultso you don’t need to install it again. To check if Git is installed, you can check it by using the version check command as follows:
git --version
If you have previously installed Git on Linux, it will appear output notification of the version of Git that is on your device, as shown below:
Meanwhile, if you don’t have Git, it will appear output which tells you that if Git is not already installed on the device you are using, you must install it first.
Install Git on Debian, Ubuntu and Derivatives.
On Debianm Ubuntu and derivatives, you can install Git using management package aptbut before installing, run the command first upgrade and updates to update the list package in repositoryas follows:
sudo apt-get upgrade sudo apt-get update sudo apt install git
Wait for the process upgrade, updateand the Git installation to complete and make sure not error that happened.
Install Git via PPA Repository
On Debian/Ubuntu and derivatives, you can also install Git via a PPA repository which provides stable version upstream last from Git.
Add PPA repository Git using the following command:
sudo add-apt-repository ppa:git-core/ppa
Then when you’re done, do it update repository and install Git using the following command:
sudo apt-get update sudo apt install git
Wait for the installation process to finish and make sure it’s not there error during the installation process. UTo make sure you can use the check version command “git –version” as previously.
Install Git on Fedora and its Derivatives
To install Git on Fedora, you can do that too using management default packages that is on Fedora according to the version of Fedora you are using.
On Fedora version 21 and below, you can install Git on by using package management “yum”, as follows:
yum install git
Meanwhile, if you are using Fedora 22 and above, you can install Git using management package “dnf”, as follows:
dnf install git
Then wait for the installation process to complete. To check if Git has been installed successfully, you can use the “check version” command.git –version” as previously.
How to Install Git on Windows
If you are using Windows, you can install Git on by downloading the file package Git installation on the official Git site. Download file package installation of the latest version of Git according to the Windows architecture you are using; 64 bit or 32 bit.
After successful download, open the installation file. Then an installation window will appear showing the information copyrightafter agreeing with copyright from Git usage, select Next to proceed to the next step.
Then you will be advised to determine what components to install, for completeness of features, just select everything except “daily Git latest version check” as shown below, then select Next:
Then a window will appear asking you to choose text editor which is used for Git, select text editor that you usually use, then select Next to continue.
Next is to choose path environment that you will use for Git, choose the second option, namely “Use Git from the Windows Command Prompt”so you can use Git via path CMD, then select Next:
Then a window will appear asking you to select SSLTLS library which you will use, just choose the first choice because the first choice “Use the OpenSSL library” by choice default and widely used, then select Next.
On the next menu, choose the first option”Checkout Windows-style, commit Unix-style line endings” and select Next, like the following picture:
Next, select terminal emulator which you will use on Git Bash, just select terminal default emulator “Use Windows’ default console window” and then select Next.
Then you will be asked to activate the additional features that you will use, just select the features default in the first and second choices as in the image below, then select Install to start installing Git:
Then wizard The installation will start installing Git on your Windows, wait for the installation process to complete.
Once the installation process is complete you can exit the installation wizard, and start using Git. To be sure, you can check if Git is installed properly by using the check version command “git –version”, if Git is installed correctly it will appear output Git version as follows:
Once you’ve made sure that Git is installed, you can now use Git as a version controller in app development. In the next section we’ll learn how to pre-configure Git before using Git.