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.
Learn more about Git
- What is Git and why it is used?
- How to install Git on Windows & Mac?
- How to use Git with Visual Studio Code?
- How to use Git and GitHub?
- What is the difference between Git and GitHub?
- How to connect local Git to a remote server?
- How to change Git remote origin URL?
- How to create a Git repository on GitHub?
- Git add all (stage all changes)
- How to undo the git add -A command?
- How to undo the last Git commit?
- How to change the git commit message?
- How to remove or unstage a file from Git commit?
- How to git push after rebase?
- Git switch branches: How to checkout the git branch?
- How to merge a git branch to master?
- Git branch: create, checkout, merge, list, command, delete & push
- How to clone a Git repository?
- How to git pull to override the local project?
- How to remove file from Git?
- When should you use git rebase?
- Git commands & explanation (downloadable cheatsheet included)
- How to create GitHub Pages?
Conclusion
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:
git --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.