Tag Archives: scm sync

Jenkins Fixing SCM Sync with Git and Failing with Delete Jobs


I have encountered this several times where if you try and change a job name along with any configuration for a job Git will get into a bad state and the SCM will start throwing up errors like:

delete Jobs/OLD_JOB_NAME 

The only thing I have found is to fix this is to follow the following steps:

You will have to have admin rights and the ability to restart your jenkins.

  1. recreate the OLD_JOB_NAME
  2. change the system configuration scm sync to none.
  3. restart the jenkins.  via your_jenkins_server/restart
    1. change the system configuration scm sync to git.
  4. Ensure that the configuration is now syncing correctly  and you do not have any more errors.
  5. delete OLD_JOB_NAME again.
  6. If this still does not work you can try downgrading the plugin and repeating the steps again.


You may lose all your job configurations after you reenable the SCM sync so you will have to make a small change to each job name such as changing the description by a single letter.



Managed Script plugin and SCM sync on Jenkins

If you are using https://wiki.jenkins-ci.org/display/JENKINS/Managed+Script+Plugin  and the https://wiki.jenkins-ci.org/display/JENKINS/SCM+Sync+configuration+plugin

You will have to add a Manual synchronization includes: 


to get it to save the managed files configuration.  Otherwise all your managed script files you share across jobs will be lost if you lose the jenkins server and have to rebuild it.