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

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
• 18,570 points

4 answers to this question.

0 votes
While pulling the code from GIT using Jenkins it was setting the http_proxy to (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
• 52,360 points
Could you please share the URL format which you have added in no proxy host .
Copy your Git URL and paste as it is.
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?

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, 2019 in Git & GitHub by Alok
0 votes
1 answer
0 votes
1 answer

I want to create a repository on folder level in Git. Is this possible?

That is possible but ideally, you should ...READ MORE

answered Sep 28, 2020 in Git & GitHub by Mudit
0 votes
1 answer

How to find the hidden files in the Git repository?

Hi@akhtar, To find the hidden files in the ...READ MORE

answered Nov 19, 2020 in Git & GitHub by MD
• 95,440 points
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 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
• 52,360 points
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP