Installing Git
Last updated onVersion control is critical in software projects. One such tool is Git, which has found target use among many users. Installing Git is the starting point. In this tutorial, we will go through installing Git on the most popular operating systems. Not to worry, the instructions were tailored for Windows users, but macOS and Linux users can also follow along. In the end, you will be able to handle your code over any platform.
Anyway, in the following section, you will learn about the system requirements before we start.
Anyway, in the following section, you will learn about the system requirements before we start.
System Requirements
Before installing Git, ensure the following requirements are met on your operating system. Here’s what you need:
- Windows: Works with Windows 7 and later. Keep your system updated.
- macOS: Git is supported on macOS 10.9 (Mavericks) and above. Make sure you are using a proper version.
- Linux: You can run Git on most versions of Linux. Make sure your distribution is up to date.
Prerequisites:
- Windows — (You may need a package manager, like Chocolatey or the Git installer).
- macOS — You may need to install Xcode Command Line Tools. You can install it using the Terminal.
- Linux — Depending on your distribution you may need to use package managers such as APT, YUM, or Pacman Install Git.
You should have internet in your system as you will require the files to be downloaded. Understanding these requirements will help you to have a painless experience while installing the tools.
If your operating system is all good, let's move into the section below to install Git in Windows OS.
Installing Git on Windows
If you are working on the Windows operating system, download the Git installer from its official site.
When you open it you will see the screen as below.
Once you've downloaded it, double-click the installer to begin the installation procedure.
It will display a screen with some information regarding the installation license. You have to click on the "next" button to proceed.
It will display another screen with the destination location. To alter the location of the git package, click the "browse" button. But I propose that you keep the default choice and click the "next" button.
In the next screen, it will show you options for the program components.
Simply stick with the default options and click the "Next" button.
You will be able to choose the git bash default editor on the next screen. Simply choose "Use Vim as the default git editor" as the first option.
You have options to modify your path environment on this screen. Simply select the suggested choice and press the "next" button.
You will notice the SSH executable option in the following step. Simply leave it at the default setting.
You will see an additional option for the HTTP transport backend in the screen that follows. Simply select the default setting and press the "Next" button.
Additionally, you will see another choice to select the Windows command style on the screen that follows. Press the "Next" button to utilize the default.
In the final screen, after selecting the default selections, just click on the install button, as shown in the picture below.
Check Git Bash Installation
Then click the Windows icon and search for git bash to launch git bash. An interface for the command line will open like the below image.
You can use a different program if you are not comfortable with the git bash instructions. It's called the Git GUI.
You may use the git bash command to find out the current version of git on your computer by typing the following command:
git -v
Let's go to the Ubuntu operating system installation procedure.
Installing Git Bash on Ubuntu
In this step, I'll install the GIT remote system using the Ubuntu apt package. Come on, let's do it.
Firstly, you must upgrade the current Ubuntu package. You must run the following command in the terminal to accomplish that.
git apt update
Next, use the following command to begin the installation of Git:
git apt install git
The next git command must be executed to obtain the most recent version.
git --version
In the next section, I will switch to another popular OS and show you how Git can be installed there. Now, let's get started.
Installing Git Bash on macOS
For Installing git bash on a macOS computer, you need to go through an official page. and start the download process.
After it's done, follow the directions on the installer screen to begin the installation.
Installing the git control system via the terminal is quite simple; simply type the following command:
brew install git
All right, let's get started with the local machine's git settings.
Configure Git with Email and Username
To provide the current user on the local computer and make this user known in every git project, use the following git commands. This command is used to configure the username in git.
git config --global user.name [YOUR NAME HERE]
Also, you can configure the email of your local repository by the command below.
git config --global user.email[YOUR EMAIL HERE]
Let's summarize it.
Wrapping Up
In this tutorial, we have shown you how to install Git on the Windows operating system, Ubuntu and macOS. Here are the key points:
On Windows, you simply download the Git installer from the official website. After that follow up the installation steps by clicking on them to initiate downloading archive. Click "Next" through all of the prompts until you finish your steps.
If you're not comfortable with Git Bash, choose the Git GUI.
You will also have noted that it is a little changed procedure if you are installing Git on Ubuntu but nothing overly complex. You will first update your system; then you install git itself, all through the terminal — a place where you type in commands. This involves a few commands like updating your package list, installing Git, etc. Then, you can confirm the installation of Git by checking out the version information to make sure everything is finished.
The same methods are used for macOS users. Git can be installed using Homebrew (which is convenient for some), or you may download Git directly from the official website. Homebrew is kind of like a magic wand to install software in Mac and all you need is one flick or command to get Git.
To verify whether Git is installed successfully, you need to run this short command: git -v
.
Thank you for reading. Happy Coding!