Showing posts with label jenkins Failed to connect to repository. Show all posts
Showing posts with label jenkins Failed to connect to repository. Show all posts

Monday, October 19, 2020

jenkins error - Failed to connect to repository : Command 'git ls-remote -h'

If you are adding a repository in 'Source Code Management' section of Jenkins and after adding correct username and password as a credentials, it is still showing 'Failed to connect to repository' error then this solution might work for you.

Solution :

check the character '@' in your username and password. I would suggest you to not use email as your git username. To remember username, people use complete email as a username. If your email is john.doe@mail.com, I would suggest you to not use 'john.doe@mail.com' as a username. You can use john.doe or if it is not available, you can use any number after it.

Similarly you should not use '@' in the password too.

After replacing '@' with other special character like '_', you should try to connect git repository from Jenkins again.