page_title | subcategory | description |
---|---|---|
git_add Resource - terraform-provider-git |
Add file contents to the index similar to git add. |
Add file contents to the index similar to git add
.
# add single file
resource "git_add" "single_file" {
directory = "/path/to/git/repository"
add_paths = ["path/to/file/in/repository"]
}
# add all files in directory and its subdirectory recursively
resource "git_add" "single_directory" {
directory = "/path/to/git/repository"
add_paths = ["path/to/directory/in/repository"]
}
# add files matching pattern
resource "git_add" "glob_pattern" {
directory = "/path/to/git/repository"
add_paths = ["path/*/in/repo*"]
}
# mix exact paths and glob patterns
resource "git_add" "glob_pattern" {
directory = "/path/to/git/repository"
add_paths = [
"path/*/in/repo*",
"another/path/to/file/here",
"this/could/be/a/directory",
]
}
directory
(String) The path to the local Git repository.
add_paths
(List of String) The paths to add to the Git index. Values can be exact paths or glob patterns.
id
(Number) The timestamp of the last addition in Unix nanoseconds.