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 $WORKSPACEIt Clears the all local changes which is not tracked by your Git repo and checkout only the latest changes from remote repo.
git clean -df
git checkout -- *
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