GIT plugin in jenkins not able to connect to GIT repository

+1 vote

I am trying to pull the code form GIT using GIT Plugin Jenkins and the job is running on a slave machine.

MASTER system has http_proxy=mycom.domain.com:80

and in SLAVE system there is no http_proxy defined.

Whenever I am doing git clone locally in the SLAVE machine it works perfectly, however from Jenkins I haven't been successful.

It is throwing the following error: Error fetching remote repo 'origin'
Jul 3, 2018 in Git & GitHub by Hannah
• 14,080 points
786 views

4 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
While pulling the code from GIT using Jenkins it was setting the http_proxy to mycom.domain.com:80 (MASTER machine proxy) and this proxy was not required in the SLAVEmachine.

So, I just added the GIT URL to No Proxy Host section (Manage Jenkins -> Manage Plugins -> Advanced -> HTTP Proxy Configuration -> Added GIT URL in No Proxy Host field) in Jenkins and now it is working fine.
answered Jul 3, 2018 by Kalgi
• 35,800 points
0 votes

Make sure in Jenkins credentials your password must be access token, that's a problem at your end, run Jenkins again after update it

answered Oct 25, 2018 by Kiara
hi Kiara,

I was using access token and git plugin was able to recognize git directory url.But not with same token it is not.

I have tried with new token also but the result is same.

do you have any idea for this?

Hey @Shivam, Create a new token with all the accesses. 

settings > developer settings > personal access tokens > generate new token

Hi Kalgi,

I have tried with new token also,But issue remains same,

Jenkins is  not recognizing github directory url.

do you get any specific error?
Yes,

I get below error

Jenkins stderr: Host key verification failed. fatal: Could not read from remote repository.
Are you running this command from your Jenkins master?
Hi Kalgi,

sorry for late response,

Yes,I am running commands on jenkins master.
Hey @Shivam, can you start another thread with this question? You doubt differs from the actual thread. It'll get very confusing for other readers.
0 votes

try to disable use of the git credential cache using git config --global --unset credential.helper. You may also need to do git config --system --unset credential.helper if this has been set in the system config file

answered Oct 25, 2018 by Yankie
0 votes

This looks like a git configuration issue, Try cloning the git repo from the command line.

answered Oct 25, 2018 by Alia

Related Questions In Git & GitHub

0 votes
1 answer

How to add a remote git repository in Jenkins

Follow these steps: Step 1 Go to Manage ...READ MORE

answered 3 days ago in Git & GitHub by Alok
5 views
0 votes
1 answer
0 votes
1 answer

How to do a re-merge into another branch in git

Seems like you want to rebase your ...READ MORE

answered May 7, 2018 in Git & GitHub by DareDev
• 6,560 points
61 views
0 votes
1 answer

How to view the nested workflow of a local git repository?

The ‘git log’ command is your closest ...READ MORE

answered Jul 4, 2018 in Git & GitHub by Sophie may
• 9,050 points
38 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

gerrit-cherry-pick:fatal: 'origin' does not appear to be a git repository

The user account making that command does ...READ MORE

answered Aug 13, 2018 in Git & GitHub by Kalgi
• 35,800 points
113 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.