Git: Installing Git in PATH with GitHub client for Windows

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:

  1. Get the Git URLWe need to get the url of the Git \cmd directory your computer. Git is located here:C:\Users\<user>\AppData\Local\GitHub\PortableGit_<guid>\cmd\git.exe So on your computer, replace <user> with your user and find out what the <guid> is for your computer. (The guid 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:;C:\Users\<user>\AppData\Local\GitHub\PortableGit_<guid>\cmd (Note: \cmd at the end, not \cmd\git.exe anymore!)On my system, it’s this, yours will be different:;C:\Users\brenton\AppData\Local\GitHub\PortableGit_7eaa494e16ae7b397b2422033as45d8ff6ac2010\cmd
  2. Edit the PATH VariableNavigate to the Environmental Variables Editor (instructions) and find the Path variable in the “System Variables” section. Click Edit… 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)

Leave a Comment