title: Buildkite Windows agent cannot find git executable
body: <p>I'm having trouble getting the Windows build agent to run a build. The agent is unable to checkout my source code. (Im using Windows 10) <a href="https://github.com/buildkite/agent/issues/487" rel="nofollow noreferrer">See GitHub issue</a></p>
  
  <p>I am seeing the following error when running a build:</p>
  
  <pre><code>Buildkite Error: There was an error running `git clone -v -- git@github.com:myorg/myrepo.git .` (exec: "git": executable file not found in %PATH%)
  </code></pre>
  
  <p>I have installed <code>git</code> using <code>chocolatey</code> and <code>git</code> is accessible in CMD and Powershell on the agent's host and I can see it in my path if I run <code>gci env:Path</code> in Powershell. <code>git</code>'s directory is at the end here:</p>
  
  <pre><code>C:\Program Files\Docker\Docker\Resources\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cm...
  </code></pre>
  
  <p>From a build's logs in BK's web UI, I see the following environment variables printed out:</p>
  
  <pre><code>BUILDKITE=true
  BUILDKITE_AGENT_ACCESS_TOKEN=xxx
  BUILDKITE_AGENT_DEBUG=true
  BUILDKITE_AGENT_ENDPOINT=https://agent.buildkite.com/v3
  BUILDKITE_AGENT_ID=xxx
  BUILDKITE_AGENT_NAME=DESKTOP-1
  BUILDKITE_AGENT_PID=5180
  BUILDKITE_ARTIFACT_PATHS=
  BUILDKITE_BIN_PATH=C:\Users\Jason\Downloads\buildkite-agent-windows-amd64-3.0-beta.27
  BUILDKITE_BRANCH=fix/build
  BUILDKITE_BUILD_CHECKOUT_PATH=builds\DESKTOP-1\myorg\myrepo
  BUILDKITE_BUILD_CREATOR=Jason
  BUILDKITE_BUILD_CREATOR_EMAIL=myemail@gmail.com
  BUILDKITE_BUILD_ID=xxx
  BUILDKITE_BUILD_NUMBER=18
  BUILDKITE_BUILD_PATH=builds
  BUILDKITE_BUILD_URL=https://buildkite.com/myorg/myrepo/builds/18
  BUILDKITE_COMMAND=msbuild
  BUILDKITE_COMMAND_EVAL=true
  BUILDKITE_COMMIT=HEAD
  BUILDKITE_GIT_CLEAN_FLAGS=-fxdq
  BUILDKITE_GIT_CLONE_FLAGS=-v
  BUILDKITE_HOOKS_PATH=hooks
  BUILDKITE_JOB_ID=xxx
  BUILDKITE_MESSAGE=First build
  BUILDKITE_ORGANIZATION_SLUG=myorg
  BUILDKITE_PIPELINE_DEFAULT_BRANCH=master
  BUILDKITE_PIPELINE_PROVIDER=github
  BUILDKITE_PIPELINE_SLUG=myrepo
  BUILDKITE_PLUGINS_PATH=plugins
  BUILDKITE_PROJECT_PROVIDER=github
  BUILDKITE_PROJECT_SLUG=myorg/myrepo
  BUILDKITE_PULL_REQUEST=false
  BUILDKITE_PULL_REQUEST_REPO=
  BUILDKITE_REPO=git@github.com:myorg/myrepo.git
  BUILDKITE_REPO_SSH_HOST=github.com
  BUILDKITE_RETRY_COUNT=0
  BUILDKITE_SCRIPT_PATH=msbuild
  BUILDKITE_SOURCE=ui
  BUILDKITE_SSH_FINGERPRINT_VERIFICATION=true
  BUILDKITE_TAG=
  BUILDKITE_TIMEOUT=false
  CI=true
  PATH=C:\Users\Jason\Downloads\buildkite-agent-windows-amd64-3.0-beta.27;
  PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL
  </code></pre>
  
  <p>Note that <code>PATH</code> in that output is not the same as my <code>PATH</code> from the Powershell and does not include the path to gits binary.</p>
  
  <p>Full build output:</p>
  
  <pre><code>Build environment variables 0s
  BUILDKITE=true
  BUILDKITE_AGENT_ACCESS_TOKEN=xxx
  BUILDKITE_AGENT_DEBUG=true
  BUILDKITE_AGENT_ENDPOINT=https://agent.buildkite.com/v3
  BUILDKITE_AGENT_ID=xxx
  BUILDKITE_AGENT_NAME=DESKTOP-1
  BUILDKITE_AGENT_PID=5180
  BUILDKITE_ARTIFACT_PATHS=
  BUILDKITE_BIN_PATH=C:\Users\Jason\Downloads\buildkite-agent-windows-amd64-3.0-beta.27
  BUILDKITE_BRANCH=fix/build
  BUILDKITE_BUILD_CHECKOUT_PATH=builds\DESKTOP-1\myorg\myrepo
  BUILDKITE_BUILD_CREATOR=Jason
  BUILDKITE_BUILD_CREATOR_EMAIL= myemail@gmail.com
  BUILDKITE_BUILD_ID=xxx
  BUILDKITE_BUILD_NUMBER=18
  BUILDKITE_BUILD_PATH=builds
  BUILDKITE_BUILD_URL=https://buildkite.com/myorg/myrepo/builds/18
  BUILDKITE_COMMAND=msbuild
  BUILDKITE_COMMAND_EVAL=true
  BUILDKITE_COMMIT=HEAD
  BUILDKITE_GIT_CLEAN_FLAGS=-fxdq
  BUILDKITE_GIT_CLONE_FLAGS=-v
  BUILDKITE_HOOKS_PATH=hooks
  BUILDKITE_JOB_ID=xxx
  BUILDKITE_MESSAGE=First build
  BUILDKITE_ORGANIZATION_SLUG=myorg
  BUILDKITE_PIPELINE_DEFAULT_BRANCH=master
  BUILDKITE_PIPELINE_PROVIDER=github
  BUILDKITE_PIPELINE_SLUG=myrepo
  BUILDKITE_PLUGINS_PATH=plugins
  BUILDKITE_PROJECT_PROVIDER=github
  BUILDKITE_PROJECT_SLUG=myorg/myrepo
  BUILDKITE_PULL_REQUEST=false
  BUILDKITE_PULL_REQUEST_REPO=
  BUILDKITE_REPO=git@github.com:myorg/myrepo.git
  BUILDKITE_REPO_SSH_HOST=github.com
  BUILDKITE_RETRY_COUNT=0
  BUILDKITE_SCRIPT_PATH=msbuild
  BUILDKITE_SOURCE=ui
  BUILDKITE_SSH_FINGERPRINT_VERIFICATION=true
  BUILDKITE_TAG=
  BUILDKITE_TIMEOUT=false
  CI=true
  PATH=C:\Users\Jason\Downloads\buildkite-agent-windows-amd64-3.0-beta.27;
  PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL
  Running global environment hook 0s
  # Skipping, no hook script found at "hooks\environment.bat"
  Running global pre-checkout hook    0s
  # Skipping, no hook script found at "hooks\pre-checkout.bat"
  Preparing build directory   0s
  # Changing working directory to "builds\DESKTOP-1\myorg\myrepo"
  ⚠ Buildkite Warning: Could not performn `ssh-keygen` (exec: "ssh-keygen": executable file not found in %PATH%)
  &gt; git clone -v -- git@github.com:myorg/myrepo.git .
   Buildkite Error: There was an error running `git clone -v -- git@github.com:myorg/myrepo.git .` (exec: "git": executable file not found in %PATH%)
  </code></pre>