I want to sync my Jenkins backup data with git repo. so i follow following steps:
1- I have set git global credential into jenkins GIT option under configuration.
2- Installed scm sync plugin and put configuration parameter in jenkins scm sync configuration tab repo url [email protected]:username/jenkins_config.git
3 - save
But i am getting below error:
"Error while adding SCM file : fatal: Not a git repository (or any of the parent directories): .git"
I just ran into this problem. As a preface: this plugin is generally really frustrating to do anything with because of how opaque and unhelpful the error messages are. That said, what the issue actually meant in my case is one of a few things I had to do to correct the issue:
git@github/
instead of git@github:
).Aside from those, the system log info in hudson.plugins.scm_sync_configuration
is particularly helpful, and frequently more telling than the general page errors.
This sequence worked for me with Git:
In a scratch directory, verify that all files are present using:
git clone git@[email protected]:username/jenkins_config.git
cd jenkins_config
find .
Hopefully find
will print all your config.xml
files.
I recorded the exact steps I took above. I do not know if they are all absolutely necessary (particularly steps 2 and 4). The strategy is to repeatedly restart and remove/add the Git Repository URL until it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With