From 22ed5ab013320b632401764e4c97dfab46956730 Mon Sep 17 00:00:00 2001 From: Jon-Paul Lindquist Date: Thu, 2 May 2024 10:23:12 -0700 Subject: [PATCH] Update Documentation / Examples for Git Includes --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ad3bca0b..fd7914fe 100644 --- a/README.md +++ b/README.md @@ -665,11 +665,11 @@ vcsrepo { '/path/to/repo': ####Checking out only specific paths -**Note:** The `includes` param is only supported when subversion client version is >= 1.6. +**Note:** The `includes` param is supported on all git clients, and subversion clients with version >= 1.6. You can check out only specific paths in a particular repository by providing their relative paths to the `includes` parameter, like so: -~~~ +~~~ puppet vcsrepo { '/path/to/repo': ensure => present, provider => svn, @@ -683,6 +683,20 @@ vcsrepo { '/path/to/repo': } ~~~ +~~~ puppet +vcsrepo { '/path/to/repo': + ensure => present, + provider => git, + source => 'http://svnrepo/hello/trunk', + includes => [ + 'root-file.txt', + 'checkout-folder', + 'file/this-file.txt', + 'folder/this-folder/', + ] +} +~~~ + This will create files `/path/to/repo/file-at-root-path.txt` and `/path/to/repo/file/nested/within/repo.jmx`, with folders `/path/to/repo/some-folder` and `/path/to/repo/nested/folder/to/checkout` completely recreating their corresponding working tree path. When specified, the `depth` parameter will also be applied to the `includes` -- the root directory will be checked out using an `empty` depth, and the `includes` you specify will be checked out using the `depth` you provide. @@ -843,7 +857,7 @@ Parameters: `basic_auth_password`, `basic_auth_username`, `configuration`, `conf * `depth` - Supports shallow clones in `git` or sets the scope limit in `svn`. (Available with `git` and `svn`.) * `filesystem_types` - Supports multiple types of filesystem. (Available with `svn`.) * `gzip_compression` - Supports explicit GZip compression levels. (Available with `cvs`.) -* `include_paths` - Lets you checkout only certain paths. (Available with `svn`.) +* `include_paths` - Lets you checkout only certain paths. (Available with `git` and `svn`.) * `modules` - Lets you choose a specific repository module. (Available with `cvs`.) * `multiple_remotes` - Tracks multiple remote repositories. (Available with `git`.) * `reference_tracking` - Lets you track revision references that can change over time (e.g., some VCS tags and branch names). (Available with all providers)