I am using jenkins and trying to connect to the bit bucket remote repository for that I provide the bit bucket URL in source code management in git repositories, I create the credentials also for that bit bucket account added in the credentials
I tried the below in git repositories
https://[email protected]/gsmohan/quickride.git
But it gives the error below specified:
ERROR:Failed to connect to repository : Failed to connect to https://[email protected]/gsmohan/quickride.git using credentials bitbucket account (status = 401)
Can anyone please help to me?
You might need to set the path to your git executable in Manage Jenkins -> Configure System -> Git -> Git Installations -> Path to Git executable.
Add the public key to your Account settingsOpen your .ssh/id_rsa.pub file (or whatever you named the public key file) and copy its contents. You may see an email address on the last line. It doesn't matter whether or not you include the email address. From Bitbucket, click Add key.
Change repository address to this format:
https://user:[email protected]/user/project_name.git
And of course:
In Jenkins ver. 2.6 just use
https://[email protected]/user/project_name.git
And add your credentials.
Important: Make sure that your git installed version is greater or equals than 1.7.4
because of the --local
issue.
If you are on CentOS maybe you face the same problem than me. Here is a great answer from @AmirHd to upgrade git version on CentOS, if you already have git installed just type:
yum --disablerepo=base,updates --enablerepo=rpmforge-extras update git
Hope this helps!!!
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