Jenkins – Git – Failing to checkout from Git Repository

I have a git repo that I am using for a build in Jenkins. The build fails consistently with the following error:

Seen 1 remote branch
Commencing build of Revision 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc (origin/master)
Checking out Revision 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc (origin/master)
 > C:\Program Files (x86)\Git\cmd\git.exe config core.sparsecheckout
 > C:\Program Files (x86)\Git\cmd\git.exe checkout -f 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc
FATAL: Could not checkout null with start point 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc
hudson.plugins.git.GitException: Could not checkout null with start point 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:1497)
    at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.checkout(AbstractGitAPIImpl.java:64)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkout(CliGitAPIImpl.java:87)
    at hudson.plugins.git.GitAPI.checkout(GitAPI.java:208)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1273)
    at hudson.plugins.git.GitSCM.access$1100(GitSCM.java:57)
    at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1232)
    at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1208)
    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2439)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:328)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at hudson.remoting.Engine$1$1.run(Engine.java:63)
    at java.lang.Thread.run(Unknown Source)
Caused by: hudson.plugins.git.GitException: Command "C:\Program Files (x86)\Git\cmd\git.exe checkout -f 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc" returned status code 1:
stdout: 
stderr: error: unable to create file 

There is one branch master and the sha-1 is the latest checkout. Also the following appears :

  • Is “git reset --hard” the same as “git reset --hard HEAD”?
  • configuring existing git repo for sparse checkout
  • Is there a way to tell Capistrano to deploy a Local Repository to a Remote Server?
  • git detect if there are untracked files quickly
  • git on mac os from homebrew: fatal: unable to access
  • retrieve git commit never pushed
  • Note: checking out '30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by performing another checkout.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -b with the checkout command again. Example:
    
      git checkout -b new_branch_name
    
    HEAD is now at 30c6a7a... Update README.md
    

    I am not sure why jenkins thinks the repo is in headless state?

  • Benefits of using git branches vs. multiple repositories
  • Remedy for both revision and filename
  • Create a new file in git bash
  • Why use rebase if it forces you to stay local?
  • Is it possible to ban a list of words with ESlint or anything else when pre-commit?
  • Is it possible to store only a checksum of a large file in git?
  • One Solution collect form web for “Jenkins – Git – Failing to checkout from Git Repository”

    I had the same problem, and what was wrong was that the file path was too long, so I changed my workspace to be a shorter string and it worked again.

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