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(
    at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.checkout(
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkout(
    at hudson.plugins.git.GitAPI.checkout(
    at hudson.plugins.git.GitSCM.checkout(
    at hudson.plugins.git.GitSCM.access$1100(
    at hudson.plugins.git.GitSCM$4.invoke(
    at hudson.plugins.git.GitSCM$4.invoke(
    at hudson.FilePath$
    at hudson.remoting.UserRequest.perform(
    at hudson.remoting.UserRequest.perform(
    at hudson.remoting.Request$
    at hudson.remoting.InterceptingExecutorService$
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$ Source)
    at hudson.remoting.Engine$1$
    at Source)
Caused by: hudson.plugins.git.GitException: Command "C:\Program Files (x86)\Git\cmd\git.exe checkout -f 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc" returned status code 1:
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

    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.