To use Git and remote servers like GitHub, Bitbucket, etc, your first instinct should be to ensure that Git is installed on your machine/computer. Mac generally comes with Git preinstalled. On a Windows computer, you have to install it.
How to install Git on Windows?
To install Git on your Windows computer, go to git-scm.com and download it. After downloading install it. The installation process is the same as other general software.
During the installation process, click on “Next” as many times as it comes. Any default options are fine.
After installing it, go to the “Start” menu and you will find a new option called “Git Bash.” This is your command line on Windows.
VS Code terminal (an alternative to Git Bash)
However, if you use VS Code, you don’t need to use Git Bash. Because VS Code has a built-in terminal you can use to type commands.
To open the terminal in VS Code editor, hit “Ctrl + `” or click on the “Terminal” menu from the top navigation (Menu Bar). For more detailed instructions see how to use Git with Visual Studio Code.
Install Git on Mac
As mentioned earlier, Mac comes with Git pre-installed. To access it, click on the magnifying glass icon in the top-right corner and search for “Terminal” (as you see below screenshot).
However, if you do not find the terminal on your Mac, you have to download & install Git from the same website that I mentioned in the Windows version. See the screenshot below as a reference.
This is how to install Git. Learn how to use Git & servers like GitHub.
Your first-time Git configuration in terminal (Bash)
The above video shows how to configure your terminal (and Git Bash) for the first time.
Now you know how to install Git on a Windows & Mac computer. No matter if you’re using a built-in terminal on an IDE or code editor like VS Code, you do need to ensure that Git is installed correctly on your machine.
To check whether Git is installed or not, type the following command to check the version:
You don’t need to match the version number with mine. As long as you see a version number, you’re good to go. See the common git commands to make your hand dirty.