<ol>
<li><p>You can use a plugin called <a href="https://plugins.jenkins.io/ws-cleanup/" rel="nofollow noreferrer">&quot;Workspace Cleanup Plugin&quot;</a> which wipes out the workspace post build. This can be a part of the pipeline and would not require manual cleanup every time when a build should be triggered.</p>
</li>
<li><p>For the second issue, I would recommend you to check if you're able to checkin to the same repository with git credentials configured in jenkins settings through the command line in the slave.</p>
</li>
</ol>

CC BY-SA 4.0
2020-08-12T03:37:36.813Z
Hi Thanks for the response, The main issue is i cannot cleanup the repository because the project is a very big one and checking out takes alomost a hour and we dont want to clean up but pull the commits correctly.
Sri Krishna
CC BY-SA 4.0
2020-08-10T19:49:55.430Z
2020-08-10T19:49:55.430Z
Sreekar Reddy Velayudham
<p>I have a Jenkins pipeline where after every build I change a file(increase build version in a property file) and checkin back to the git repository. After a build, I commit some differnt code change to the git repo and run the build. One of the following two things happen</p>
<ol>
<li>Jenkins does not pull the latest code change from git to master machine or slave machine.</li>
<li>The build increment checkin stage fails when we checkin from Jenkins slave.</li>
</ol>
<p>The only solution is to wipe up the repository and build it again . Our project is a very big one and doing this every time causes a lot of time-wasting.</p>
<p>What configuration am i missing?</p>

<jenkins><jenkins-pipeline><git>
Jenkins Not pulling the latest commit into master or slave
Sri Krishna
# Jenkins Not pulling the latest commit into master or slave

(Asked by: username_0 on 2020-08-05)

I have a Jenkins pipeline where after every build I change a file(increase build version in a property file) and checkin back to the git repository. After a build, I commit some differnt code change to the git repo and run the build. One of the following two things happen

1. Jenkins does not pull the latest code change from git to master machine or slave machine.
2. The build increment checkin stage fails when we checkin from Jenkins slave.

The only solution is to wipe up the repository and build it again . Our project is a very big one and doing this every time causes a lot of time-wasting.

What configuration am i missing?

**Tags:** jenkins, jenkins-pipeline, git


---

## 1 answers

### Answer by username_1 on 2020-08-10. Score: 1

1. You can use a plugin called ["Workspace Cleanup Plugin"](https://plugins.jenkins.io/ws-cleanup/) which wipes out the workspace post build. This can be a part of the pipeline and would not require manual cleanup every time when a build should be triggered.
2. For the second issue, I would recommend you to check if you're able to checkin to the same repository with git credentials configured in jenkins settings through the command line in the slave.

> **Comments:**
> **username_0**: Hi Thanks for the response, The main issue is i cannot cleanup the repository because the project is a very big one and checking out takes alomost a hour and we dont want to clean up but pull the commits correctly.  

---

