Finally, I found the solution to this issue 🙂. the problem is that we can't modify the File in the remote Git Repository via an automated script launched by Jenkins. So I created a file in the System File of the Machine where Jenkins is running in order to update the value of the variable ' increment'. and then I wrote the groovy programme that reads, increments by 1 the value and save it back to the file. thanks for your collaboration.