| Forum

How to change the Git checkout `Time Out` value in Jenkins

I have configured a new Project Build in Jenkins with Git as the code source. The repository is a huge one with lots of branches and tags. The Jenkins build fails with this error.

 > git fetch --tags --force --progress -- https://github.<org>.com/<org>/project.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.<org>.com/<org>/project.git
at hudson.plugins.git.GitSCM.fetchFrom(
	at hudson.plugins.git.GitSCM.retrieveChanges(
	at hudson.plugins.git.GitSCM.checkout(
	at hudson.scm.SCM.checkout(
	at hudson.model.AbstractProject.checkout(
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(
	at jenkins.scm.SCMCheckoutStrategy.checkout(
	at hudson.model.AbstractBuild$
	at hudson.model.Run.execute(
	at hudson.model.ResourceController.execute(
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -
Receiving objects:  47% (109819/230807), 1.23 GiB | 1.83 MiB/s
error: index-pack died of signal 15
fatal: index-pack failed

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(
	at hudson.plugins.git.GitSCM.fetchFrom(
	... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE

I think it is because since the source code is huge, it is taking more than 10 minutes to checkout, and it timeout by 10minutes.
How to change this default behavior?

To change the default timeout value in Jenkins for Git Checkout, navigate to the project configure page and under Source Code Management section for Git, click on AddAdvanced clone behaviours.

Set the time out value to your desired value.