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?
This question is related to
git
github
github-for-windows
If you use SmartGit on Windows, the executable might be here:
c:\Program Files (x86)\SmartGit\git\bin\git.exe
I installed GitHubDesktop
on Windows 10 and git.exe
is located there:
C:\Users\john\AppData\Local\GitHubDesktop\app-0.7.2\resources\app\git\cmd\git.exe
I would like to add one more thing to what the other answers have said. It is not compulsory that path will be:
C:\Users\<user>\AppData\Local\GitHub\PortableGit_<guid>\bin\git.exe
In my computer I did not found Git
there.
BUT git and cmd are located in
git.exe
C:\Program Files\Git\bin\git.exe
cmd
C:\Program Files\Git\cmd
To add into PATH:
Add the path to git’s bin and cmd at the end of the string like this:
;C:\Program Files\Git\bin\git.exe;C:\Program Files\Git\cmd
OR
;C:\Users\<user>\AppData\Local\GitHub\PortableGit_<guid>\bin;C:\Users\<user>\AppData\Local\GitHub\PortableGit_<guid>\cmd
To verify, restart cmd and type git --version
in cmd
To fix a problem, in my case: I checked Git folder under c:\program files\Git. I didn't find git.exe, so delete the Git folder and install it again. Declare them in the environment variables as shown above. the problem will be solved.
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 PathThanks everyone who have answered.I have seen all answers and to try to make it easy for everyone
Step 1: Type edit environment and select the option shown
Step 2: Select Path and click on edit
Step 3: In the end add the below statement(you can avoid the first ; if its already there)
;C:\Program Files\Git\bin\git.exe;C:\Program Files\Git\cmd
Step 4:- Click on ok
Step 5 **:- One of the important step which is highlighted by one of the users. thanks to him. Please, **CLOSE command prompt and REOPEN then try to write git.
**
**
Here is the magic
Git’s executable is actually located in:
C:\Users\<user>\AppData\Local\GitHub\PortableGit_<guid>\bin\git.exe
Now that we have located the executable all we have to do is add it to our PATH:
;C:\Users\<user>\AppData\Local\GitHub\PortableGit_<guid>\bin;C:\Users\<user>\AppData\Local\GitHub\PortableGit_<guid>\cmd
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
C:\Users\<user>\AppData\Local\Programs\Git\bin
and the git-cmd.exe in
C:\Users\<user>\AppData\Local\Programs\Git
Please note the change to Programs folder within Local from the above posts.
If you are using vscode's terminal then it might not work even if you do the environment variable thing, test by typing
git
Restart vscode, it should work.
Add
C:\Program Files\Git\bin\git.exe;C:\Program Files\Git\cmd;C:\Windows\System32
to your PATH variable
Do not create new variable for git but add them as I did one after another separating them by ;
It works for me
Search up "Edit the system environment variables" on windows search
Click environmental variable on the bottom right corner
Find path under system variables and click edit on it
Click new to add a new path
add this path: C:\Users\yourUserName\AppData\Local\GitHubDesktop\bin\github.exe
To make sure everything is working fine, open cmd, and type github.exe
Source: Stackoverflow.com