2

I made this because Git's official instruction is incomplete.

  1. go to https://git-scm.com/download/win

https://git-scm.com/book/en/v2/Getting-Started-Installing-Git to ge the install package and install it.

  1. Now you should have github UI ready for you but if are trying to run "git" in CMD, then follow the rest:

  2. Search where git is installed but some people have it in their C:\Users\xxxxxx\AppData\Local\GitHubDesktop\app-1.0.10\resources\app\git\mingw64\bin therefore they can't find it since AppData folder is hidden. To un-hide:

    • Select the Start button, then select Control Panel > Appearance and Personalization.

    • Select Folder Options, then select the View tab.

    • Under Advanced settings, select Show hidden files, folders, and drives, and then select OK.

  3. Once copy the full path and add it to the "PATH" environmental variable. Here are the steps:

    • Select Start, select Control Panel. double click System, and select the Advanced tab.

    • Click Environment Variables. ...

    • Under the System Variable (or New System Variable) window, append the full path to the end of the variable "Path".

  4. Now you should be able to run "git --version". or post your answers below.

Dbomb
  • 41
  • 5
  • 1
    You confused "git" and "GitHub Desktop" (which is a GUI that install it's own version). If you install git, there is no need to do all that. It will end in the path. You could even add a lot of Unix tools in the path (proposed as an option during install) – Philippe Dec 09 '17 at 08:39
  • This is just a documentation. I installed git and gitHub, none worked on CMD. – Dbomb Dec 09 '17 at 17:20
  • 1
    During install of git, you should have this screen https://blog.openshift.com/wp-content/uploads/imported/5-select-run-git-from-command-line.png If you choose something else than the 1st choice, you get git in the PATH. – Philippe Dec 09 '17 at 21:56
  • I wish there would be a step by step instructions from GIT but I guess we will have to do our best to document Git. Very Good By The Way – Dbomb Dec 13 '17 at 04:01
  • @TerryMeng No need: by setting the PATH as I describe in the answer below, you will have Git properly installed. – VonC Dec 13 '17 at 05:34

1 Answers1

0

With the latest Git for Windows release, all you need to do is to uncompress the archive PortableGit-2.15.1.2-64-bit.7z.exe anywhere you want and add it to your PATH (as I do here), then launch GitHub Desktop.

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%

Then you can run any Git command you want directly from a CMD shell session, or even type 'bash' and use a bash shell session.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250