Jenkins Git Plugin not pulling latest changes before building job Jenkins Git Plugin not pulling latest changes before building job jenkins jenkins

Jenkins Git Plugin not pulling latest changes before building job


Relates me to scenario where workspace wasn't getting cleaned-up, used:


I believe Jenkins pulls the changes and builds in it's own tmp directory. So, your repository directory isn't getting updated although Jenkins is properly building the new code in it's own sandbox.

My solution to this has been to add a "git pull" step in my build process like so:

When a new commit is delivered to my GitHub repo:
1. Build my project

If successful, perform the following post-build steps:
1. Execute Shell:

cd /your/repo/directory/git pull

You can obviously modify the "git pull" command to do whatever you need to do if a 'pull' doesn't work for you.


For folks using Jenkins pipeline with git plugin, use Wipe Out repository & force clone under Additional Behaviours of SCM section.

enter image description here