it:ad:git:howto:install:home

IT:AD:Git:HowTo:Install

When working on Windows, what you need is the official/endorsed IT:AD:Git For Windows.

When you install it (Q1 2016) it will install Git on a per-user basis to: %userprofile\appdata\local\programs\git

Know something about Environment Variables First

You'll be surprised by how tricky setting a Service Account's Environment Variables can get: * IT:AD:Environment Variables:HowTo:Tips Regarding PATH Notice especially the unintuitive nature of setting Local User Environment Variables…

The installer is not guaranteed to add the Git directory to the PATH environment variable.

Since it's installed on a per-user basis create a User (not System) PATH IT:AD:Environment Variables that adds the above path.

In fact, add all the following:

  • %userprofile\appdata\local\programs\git
  • %userprofile\appdata\local\programs\git\bin
  • %userprofile\appdata\local\programs\git\usr\bin (so that Powershell can get to SSH-KEYGEN, etc.

Close and reopen your IT:AD:Powershell CLI (RefreshEnv is not going to cut it) to see this take effect (type in $env:HOME to be sure).

In Windows you use %userprofile% to get to your own User directory. But Linux scripts often refer to this directory either by ~ or by $HOME.
Since Git is mostly developed by Linux users, you need to configure your station to handle this.

Create a User (not System) HOME IT:AD:Environment Variables that is equal to %userprofile%.

Close and reopen your IT:AD:Powershell CLI (RefreshEnv is not going to cut it) to see this take effect (type in $env:HOME to be sure).

Linux is a case sensitive OS, so the variable name is HOME, not home
The $HOME variable is used by IT:AD:SSH so if it's not configured, you may run into issues there. Might as well get it out of the way now…

Alternatively, you could consider using IT:AD:Chocolatey to install IT:AD:Git

#hack setting version due to: http://stackoverflow.com/a/29305866
choco install git.install -y -version:"1.9.5.20150114"  -params:'"/GitAndUnixToolsOnPat"'

#choco install "poshgit" -y 
RefreshEnv

Note that the last time I did this (Q1 2015) the choco installer installed it in a shared directory, not on a per-user basis, so you'll have to factor in all how that changes the PATH requirements.

Check that Git is installed correctly:

git --version

  • /home/skysigal/public_html/data/pages/it/ad/git/howto/install/home.txt
  • Last modified: 2023/11/04 02:22
  • by 127.0.0.1