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
• 18,520 points
19,829 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
• 52,350 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?
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, 2019 in Git & GitHub by Alok
13,650 views
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
701 views
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,460 points
16,627 views
+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
4,034 views
+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,350 points
1,943 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP