How do I install Git in my PATH
when using the GitHub client for Windows?
I'm running into errors because apparently Git is not installed in PATH. For example, using Atom, trying to install the Linter plugin gives this error:
npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.
Does GitHub for Windows install Git when it installs? (It must, otherwise how does it use Git?) I don't want to double-install it... so how do I just add the Git that's already there to PATH?
GitHub for Windows does indeed install its own version of Git, but it doesn't add it to the
PATH
variable, which is easy enough to do. Here's instructions on how to do it:Get the Git URL
We need to get the url of the Git
\cmd
directory your computer. Git is located here:So on your computer, replace
<user>
with your user and find out what the<guid>
is for your computer. (Theguid
may change each time GitHub updates PortableGit, but they're working on a solution to that.)Copy it and paste it into a command prompt (right-click > paste to paste in the terminal) to verify that it works. You should see the Git help response that lists common Git commands. If you see
The system cannot find the path specified.
Then the URL isn’t right. Once you have it right, create the link to the directory using this format:(Note:
\cmd
at the end, not\cmd\git.exe
anymore!)On my system, it’s this, yours will be different:
Edit the PATH Variable
Navigate to the Environmental Variables Editor (instructions) and find the
Path
variable in the “System Variables” section. ClickEdit…
and paste the URL of Git to the end of that string. Save! It might be easier to pull this into Notepad to do the edit, just make sure you put one semicolon before you paste in the URL. If it doesn't work it’s probably because this path got messed up either with a space in there somewhere (should be no spaces around the semicolon) or a semicolon at the end (semicolons should only separate URLs, no semicolon at beginning or end of string).If it worked, you should be able to close & reopen a terminal and type
git
and it will give you that same git help file. Then installing the Linter should work. (Atom > File > Settings > Packages > Linter)Just install git from this Download Git link and then install it on your machine then open Environment variable setting and then add new variable and add this path
Thanks Hope it will help you.
To get this to work I had to combine many of the above answers, to anyone who this might help here is my much simpler process.
If you have Windows 10 just start typing "edit environmental..." and it'll pop up right away. Click path and Edit… then paste the
;C:\Program Files\Git\bin\git.exe;C:\Program Files\Git\cmd
at the end of the path already there, don't forget the ; to separate your new github path from the current path.You do not need the guid but if you want to know how to find it open bash, type
git --man-path
Having searched around several posts. On Windows 10 having downloaded and installed Github for Windows 2.10.2 I found the git.exe in
and the git-cmd.exe in
Please note the change to Programs folder within Local from the above posts.
GitHub for Windows is now GitHub desktop.
If you have GitHub for Windows (before version 1.1), your path should be:
C:\Users\<user>\AppData\Local\GitHub\PortableGit_<guid>\cmd
If you have GitHub Desktop (from version 1.1), your path should be:
C:\Users\<user>\AppData\Local\GitHubDesktop\app-<version>\resources\app\git\cmd
After confirming and copying your path, do the following:
;
before it in the variable PathUpdated for the Github Desktop
Search up "Edit the system environment variables" on windows search
To make sure everything is working fine, open cmd, and type github.exe