SCM sync not working

I want to sync Jenkins backup data with git repository. therefore, I follow the following steps:

1- I set the global git credentials to the jenkins git parameter in the configuration.

2- Installed scm sync plugin and put the configuration parameter in jenkins scm sync configuration tab repo url git @ github.com: username / jenkins _config.git

3 - save

But I get below the error:

"Error adding SCM file: fatal: not git repository (or any of the parent directories): git."

+5
source share
2 answers

I ran into this problem. As a preface: this plugin is usually very frustrating to do anything because of how opaque and useless error messages are. However, what really meant in my case is one of several things that I had to do to fix this problem:

  • That the access group on Github that I set up for my backup did not have write access.
  • At some point, the repo was mistakenly written in the config by me ( git@github / instead of git@github : .
  • Finally, this plugin seems to have rebooted a bit. After changing the setting, restart Jenkins to get new error messages that better help diagnose the problem.

In addition, the syslog information in hudson.plugins.scm_sync_configuration especially useful and often more known than common page errors.

+3
source

This sequence worked for me with Git:

  • Install SCM Sync Plugin
  • Enter the Git repository URL in Jenkins> Configuration> SCM Configuration
  • Restart Jenkins. At this point, the SCM Sync plugin will only transfer files after I change them. All other unmodified files were not tied to Git.
  • Remove the Git repository URL in Jenkins> Configuration> SCM Sync Configuration. Click "Save."
  • Return the Git repository URL to Jenkins> Configuration> SCM Sync Configuration. Click "Save."
  • In the directory from scratch, make sure all files are present using:

     git clone git@git @github.com:username/jenkins_config.git cd jenkins_config find . 

We hope that find prints all your config.xml files.

I recorded the exact steps that I took above. I do not know if all of them are absolutely necessary (especially steps 2 and 4). The strategy is to re-restart and remove / add the Git repository URL until it works.

+2
source

All Articles