Reputation: 15086
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?
Upvotes: 5
Views: 6855
Reputation: 4030
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
Upvotes: 4