I want to run this command in the jenkinsfile
git checkout <repo> <folder name>
but I get this error
[git-checkout-example] Running shell script
+ git checkout [email protected]:sp-digital/jarvis-api.git wahahah
fatal: Not a git repository (or any of the parent directories): .git
Any idea how can I go about doing it in Jenkinsfile? can I checkout the files to a specific folder?
You can checkout files of a specific folder, not *to a specific folder.
See
git checkout
man pageBut in your case, the issue comes from your current working directory when you are executing
git checkout xxx -- path
: you need to be in a git repo.Trying to checkout a repo to a path is called
git clone
, notgit checkout
.