gitvars.bat for Github Desktop

Windows only.

Code

gitvars.bat:

@echo off
if "%1"=="findverdir" dir /b "%UserProfile%\AppData\Local\GitHubDesktop" | find "app" & exit
for /f %%i in ('"%~dpnx0" findverdir') do set "verDir=%%i"
set "Path=%Path%;%UserProfile%\AppData\Local\GitHubDesktop\%verDir%\resources\app\git\cmd"

Then, you don't have to install git independently, just use the Github Desktop's build-in client. And the build-in git will update with GithubDesktop together. Perfect!