Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins sparse checkout: only content of directory

Tags:

I have a repo: hello.git. I'm able to perform a sparse checkout: sparse checkout path: /test/test1

Now I have this in my workspace:

.../workspace/test/test1/content

I want to have the following:

.../workspace/content

Is it possible to checkout only the content of the path you describe?

like image 230
DenCowboy Avatar asked May 12 '16 08:05

DenCowboy


1 Answers

This is not possible in git.

When you checkout in sparse mode, git only updates entries matched by your configuration in $GIT_DIR/info/sparse-checkout (this is set by the Git plugin on Jenkins).

Git does not support changing the root of the working tree in checkout. So when you do a sparse checkout, you will always have the whole directory structure of the files you selected.

https://git-scm.com/docs/git-checkout

like image 189
Martin Avatar answered Sep 28 '22 01:09

Martin