Git: Automating Install & Download on Windows

Git: Automating Install & Download on Windows

Latest Git:

wget --no-check-certificate https://code.google.com/p/msysgit/downloads/list -O - 2>nul ^
| sed -n "0,/.*\(\/\/msysgit.googlecode.com\/files\/Git-.*\.exe\).*/s//http:\1/p" ^
| wget -i - -O Git-Latest.exe

or in one line:

wget --no-check-certificate https://code.google.com/p/msysgit/downloads/list  -O - 2>nul | sed -n "0,/.*\(\/\/msysgit.googlecode.com\/files\/Git-.*\.exe\).*/s//http:\1/p" | wget -i - -O Git-latest.exe

Find out where Git is installed:

reg query HKEY_CURRENT_USER\Software\Git-Cheetah -v PathToMsys ^| sed -n "s/.*REG_SZ\s*\(.*\)/\1/p"

You can use pipe inside grouping in the command line (see above example), but then don’t forget to escape it with ^

Convert path from relative to absolute

How to convert from relative to absolute path, in CLI:

pushd "%_GIT%"
set _GIT="%CD%"
popd
date 24. Apr 2013 | modified 10. Jun 2024
filename: Git » Automating Install & Download