Git is a free, open-source version control system designed to handle projects quickly and efficiently. You can use this on Windows, Mac and Linux operating systems.
This article will explain how to add the git to the Windows PATH environment variable.
git to the
PATH on Windows
Git executable files are located in the
C:\Program Files\Git\bin\git.exe and
C:\Program Files\Git\cmd. These directories must be added to the
PATH environment variable to run the program.
Let’s explain step by step how to do this.
Navigate to the System Properties on Windows
Environment variables are located under the System Properties. We can navigate there by typing
edit environment variables in the search box and clicking on the best match.
Another way to do this is as follows.
- Right-click on the
- Select the
- Scroll and click on the
Advanced System Settings.
Edit Environment Variables to Add Values to the
Environment Variables under
System Properties to add values to the
Path under the
System variables and click the
New button and add the
C:\Program Files\Git\cmd value. Save it and repeat the same process for the
If your executable files are located in the
C:\Users\<user>\AppData\Local\GitHub\PortableGit_<guid>\cmd directories, add them to the Path variable.
Save the changes and close the page.
git Command on Windows Command Prompt
Open a new command prompt. Type
git --version and press enter. The program has been successfully added to the path environment variable if you see the version information.