# Having trouble with Git SCM checkout / cloning repository with multi-branch pipelines running on Windows agents

**URL:** <https://community.jenkins.io/t/having-trouble-with-git-scm-checkout-cloning-repository-with-multi-branch-pipelines-running-on-windows-agents/1401>\
**Category:** Using Jenkins\
**Created:** [February 1, 2022, 6:50pm UTC](https://community.jenkins.io/t/having-trouble-with-git-scm-checkout-cloning-repository-with-multi-branch-pipelines-running-on-windows-agents/1401 "2022-02-01T18:50:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [February 1, 2022, 7:10pm UTC](https://community.jenkins.io/t/having-trouble-with-git-scm-checkout-cloning-repository-with-multi-branch-pipelines-running-on-windows-agents/1401/2 "2022-02-01T19:10:08Z")

</div>

> [@lbuchume](#):
>
> Caused by: java.io.IOException: Cannot run program “/usr/local/bin/git” (in directory “D:\agent\workspace\xxxxxx”): CreateProcess error=2, The system cannot find the file specified

The Jenkins agent tried to use the program `/usr/local/bin/git` as the git program. It could not find it. It could not find it because there is no program `/usr/local/bin/git` on your Windows agent.

Your choices are:

- [Enable JGit](https://plugins.jenkins.io/git-client/#plugin-content-enabling-jgit) so that you don’t need to install git on Windows. This works well with repositories less than 50 MB. Repositories over 100MB are better handled by command line git
- Install [MinGit](https://github.com/git-for-windows/git/releases) on your Windows agent and configure the PATH on the Windows agent so that it can find MinGit. The MinGit implementation is well suited to CI agent use cases. It does not have many of the user centered features of git for Windows
- Install [git for windows](https://gitforwindows.org/) on the Windows agent and configure the PATH on the agent so that it can find Windows git
- Define a global tool that will install MinGit on your Windows agent, then reference the tool in your Jenkinsfile
- Define a global tool that will install git for Windows (or PortableGit), then reference the tool in your Jenkinsfile

My preferred solution is to install MinGit on the Windows agent so that I don’t waste time downloading the tool each time the agent is reset.

---

_[View the full topic](https://community.jenkins.io/t/having-trouble-with-git-scm-checkout-cloning-repository-with-multi-branch-pipelines-running-on-windows-agents/1401)._
