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
• 17,150 points
2,390 views

4 answers to this question.

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
• 46,110 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 May 23 in Git & GitHub by Alok
110 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,810 points
216 views
0 votes
2 answers

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

The closest way to view branches in ...READ MORE

answered Aug 2 in Git & GitHub by Sirajul
• 41,000 points
97 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
264 views
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
• 46,110 points
282 views