Quick & Easy Git Setup on macOS and Windows
How to Install Git on Mac and Windows (with Troubleshooting Steps!)
Hey there, welcome to my quick tutorial! You’ll learn how to install Git on your Mac and Windows PC. This is a crucial skill for every coder, and we’re here to make it as quick and painless as possible. Let’s get started!
STEP 1: Checking for Existing Git Installation
On Mac:
Open the Terminal app and type:
git --version
Hit Enter. If it shows a version number, Git will already be installed.
On Windows:
Open Command Prompt or PowerShell and type the same command:
git --version
If it returns a version number, Git is already installed and ready to use.
STEP 2: Installing Git
On Mac (Using Homebrew):
- The easiest way to install Git on Mac is through Homebrew. If you don’t have Homebrew installed, visit brew.sh for quick installation instructions.
- Once Homebrew is set up, open Terminal and run:
brew install git
On Windows (Using the Git Website):
- Visit git-scm.com and download the Windows installer.
- Run the installer, following the prompts. Stick with the default options unless you have specific preferences.
On Windows (Using the winget Command):
- Open PowerShell.
- Install Git using the
winget
package manager by typing:
winget install --id Git.Git -e --source wingetpowershell
STEP 3: Troubleshooting Git Installation on Windows
If Git is installed but not recognized by the system, follow these troubleshooting steps:
Check Git’s Installation Location:
Use the following command to verify if Git is installed in the default location:
ls "C:\Program Files\Git\bin"
If you see git.exe
listed, it confirms that Git is installed.
If git is installed and still not recognized, try adding it to your system path.
Add Git to the System Path:
If Git is installed but isn’t recognized, you will need to add it to your system manually. PATH
. To do this, open the Start Menu and search "Environment Variables." Click on "Edit the system environment variables," then under the System variables section, locate and select, and click Edit. Next, click New and add the following path: C:\Program Files\Git\bin
. Once you've added the path, click OK to save the changes.
STEP 4: Verifying Installation
On Mac and Windows:
After installation, open Terminal (on Mac) or PowerShell/Command Prompt (on Windows) and run:
git --version
If the version of Git is displayed, congratulations! You’ve successfully installed Git.
And that’s it! You’ve installed Git on your Mac or Windows PC, and even tackled some troubleshooting. These skills are essential in the modern coding landscape, and you’re now well-equipped for success.
This straightforward guide ensures you can efficiently set up Git on your machines, paving the way for a smoother coding journey.
Thanks for reading! Let’s keep the conversation going and stay connected:
If this guide helped you, please clap and share it with others who might find it useful. Your support means a lot.