noamtm
noamtm

Reputation: 12953

jenkins git clone: can't clone to a specific directory

According to documentation, posts and my memory, the jenkins Git plugin allows selecting the target subdirectory for a clone. I worked in another Jenkins instance I was managing. For some reason, in this new installation, I don't see that option. It's just not there. Git plugin is on the latest, version 2.3.1. I'm using the LTS release channel, so Jenkins itself is v1.580.2.

Either I'm missing something, or something is terribly wrong with my (new) installation.

Upvotes: 5

Views: 5311

Answers (2)

noamtm
noamtm

Reputation: 12953

Mystery solved: at some point, the option to select subdirectory was moved into the all-mighty "Additional Behaviours" section.

It's called "Check out to a sub-directory".

And, unlike the old option, you can't set it per-repository (if you have a few git locations).

If you (like me) need to clone a few git repositories, each to its own directory, use the Multiple SCMs Plugin, and set each git repo as a separate scm provider.

Upvotes: 10

Mateusz Was
Mateusz Was

Reputation: 303

At the bottom of Git config area there is an "Add" button and "Advance clone behaviors" option.

"Path of the reference repo to use during clone" is what you are looking for?

Upvotes: 0

Related Questions