How to reduce checkout time in Jenkins git Plugin - DevOps Commune

Hot

Post Top Ad

Thursday, October 5, 2017

How to reduce checkout time in Jenkins git Plugin

Taking too much time to checkout/Clone/Fetch the source code from repo in Jenkins with Git Plugin ?



 Here is a workaround for you. Never Delete you workspace/Wipe out the local repo before cloning the source code from remote repository. Run the below commands as first build step in your Jenkins job [ Execute Shell script or Batch Script ].
cd $WORKSPACE
git clean -df
git checkout -- *
It Clears the all local changes which is not tracked by your Git repo and checkout only the latest changes from remote repo.

Learn more about git clean refer this article: 
http://devopscommune.blogspot.in/2017/10/git-clean-remove-untracked-files-from.html

No comments:

Post a Comment

Post Top Ad