Unable to set up Git pull in Jenkins

We currently have Subversion builds in Jenkins, and are trying to add Git builds as well, using Windows filesystem access.

So far:

  • git: finding which merge brough commit into the current branch
  • How can I list all tags in my Git repository by the date they were created?
  • Can't see remote branch
  • “git checkout tag-name” vs “git reset --hard tag-name”
  • How to reference public bitbucket repo as npm module in package.json on heroku?
  • Adding file to git's stage does nothing and cannot be committed
    • Jenkins GIT Plugin is installed.
    • Jenkins and the repositories are on the same machine, so we don’t need ssh setup.
    • Started a new Jenkins Project, and clicked on Git under Source Code Management.

    We’re hitting a snag on the Repsitory URL:

    Repository URL: file:////my_server/Repositories/My_Repo
    Failed to connect to repository : Error performing command: git ls-remote -h file:////my_server/Repositories/My_Repo HEAD
    

    To troubleshoot, I created a separate project which just runs Windows commands, and confirmed that:

    1. Jenkins has permission to see the repository
    2. The Jenkins path can find git.exe
    3. I can get output from Jenkins running git ls-remote file:////my_server/Repositories/My_Repo
    4. Which means my URI format is correct

    Does anyone know how to fix the error with the Jenkins Git plugin not being able to connect to the repository, when Jenkins itself can?

    Thank you.

  • Merge some files now and some later
  • How to abort a git rebase in interactive editor
  • Is there a difference between git reset --hard HEAD and git checkout .?
  • Go back N commits in Git to find commit that causes test regressions
  • How to checkout old git commit including all submodules recursively?
  • Eclipse: How to clone git over ssh with keyfile?
  • 2 Solutions collect form web for “Unable to set up Git pull in Jenkins”

    It turns out my file URI was correct, and even though my path variables were correct and included Git, Jenkins was unable to find it using the Windows path.

    I resolve the problem by going to:

    1. Manage Jenkins
    2. Configure System
    3. Git
    4. Path to Git executable

    And entering C:\Program Files (x86)\Git\bin\git.exe

    Hope this helps someone in the future!

    Well that would be because that’s not a valid Git URI. You need to link to the C:\ or whatever drive letter path, not to a file:// url. Also, two slashes, not three.

    Git Baby is a git and github fan, let's start git clone.