Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sparse checkout gives me an error stderr: fatal: Not a valid object name HEAD

Tags:

git

jenkins

When I try to do a GIT sparse checkout in Jenkins, I get the following error:

 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision b1697de347cafa3afbd9efc364b2874994e88b0e (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git config core.sparsecheckout true # timeout=10
 > git read-tree -mu HEAD # timeout=10
Command "git read-tree -mu HEAD" returned status code 128:
stdout: 
stderr: fatal: Not a valid object name HEAD

I'm using the Multiple SCM plugin that Jenkins provides.

The files get copied to the directory, so I'm not sure why I'm getting the error.

The node is running on Centos 7

like image 772
Chris Hansen Avatar asked Nov 02 '15 19:11

Chris Hansen


2 Answers

This (actually non-fatal) error went away for me when I updated the branch from master to */master.

like image 152
bjones01001101 Avatar answered Nov 05 '22 14:11

bjones01001101


Deleting jenkins job workspace fixed the issue for me

like image 5
Tomas D Avatar answered Nov 05 '22 15:11

Tomas D