Forum Discussion
sstripatg
Sep 13, 2023Copper Contributor
How to ensure that azure pipeline self-hosted windows-build-agent uses specific git & gitconfig?
We have a set of self hosted (on-prem) windows agents. The agents runs typical git-checkout in a build. The agent uses a git binary & essentially 'gitconfig' from the path "D:/azure-agent/wntado-002/...
Kidd_Ip
Aug 06, 2025MVP
How about using System.PreferGitFromPath:
You can instruct Azure Pipelines to use the Git version installed on your server, along with its gitconfig:
variables:
System.PreferGitFromPath: true
Or, if you're using classic pipelines, you can add it in the pipeline UI under Variables.
This tells the agent to prefer the Git executable found in the system PATH, which will also respect the config at this path say D:/tools/git/etc/gitconfig.