Jenkins could not run git

前端 未结 15 1269
臣服心动
臣服心动 2020-12-29 01:22

I\'ve installed Jenkins on my mac (osx lion). But I couldn\'t get it work. This is the stacktrace I\'ve got:

Started by user anonymous

Checkout:workspace /          


        
相关标签:
15条回答
  • 2020-12-29 02:16

    I had the correct path to git in Jenkins, but I had not yet accepted the Xcode build tools EULA on a fresh install of OS X Yosemite, so git looked like it was failing in Jenkins. After trying "git --version" on the git at /usr/bin/git in a terminal, I was given a command-line interface to accept the EULA, and then Jenkins could then access the git URL I had given the build project.

    0 讨论(0)
  • 2020-12-29 02:20

    Also you can set Git location in Jenkins server/node configuration:

    goto Configure, under section Node Properties mark checkbox Tools Location and set yours path to Git.

    enter image description here

    0 讨论(0)
  • 2020-12-29 02:23

    It seems Jenkins has been changing a lot. I fixed this problem in March 2017 by doing this:

    1. Go to Manage Jenkins
    2. Go to Global Tool Configuration
    3. In Git / Path to Git executable enter C:\<whatever the path is>\git.exe.
    4. Click on Save.
    0 讨论(0)
  • 2020-12-29 02:23

    I had similar problem, the solution for Windows looks the same (my Jenkins is installed on a Windows machine):

    Global settings:

    Go to Manage jenkins -> Configure System -> Git installations add there the git exe path (for example: C:\Program Files\Git\bin\git.exe), or you can use environment variable.

    For Jenkins version 2.121.3, Go to Manage jenkins -> Global tool configuration -> Git installations -> Path to Git executable: C:\Program Files\Git\bin\git.exe

    Jenkins job side:

    Go to Source code Management -> select git, add your repository, choose connection to repository (http/ssh) and add credentials and it should work.

    0 讨论(0)
  • 2020-12-29 02:24

    In case the Jenkins is triggering a build by restricting it to run on a slave or any other server (you may find it in the below setting under 'configure')

    then the Path to Git executable should be set as per the 'slave_server_hostname' or any other server where the git commands are executed.

    0 讨论(0)
  • 2020-12-29 02:25

    I got a very similar error when my Jenkins agent was running Java 11 instead of Java 8. It had nothing to do with configuring my git path! Downgrading the agent to Java 8 was the only solution I found.

    0 讨论(0)
提交回复
热议问题