Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 1.34 KB

File metadata and controls

60 lines (44 loc) · 1.34 KB
page_title subcategory description
git_add Resource - terraform-provider-git
Add file contents to the index similar to git add.

git_add (Resource)

Add file contents to the index similar to git add.

Example Usage

# 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",
  ]
}

Schema

Required

  • directory (String) The path to the local Git repository.

Optional

  • add_paths (List of String) The paths to add to the Git index. Values can be exact paths or glob patterns.

Read-Only

  • id (Number) The timestamp of the last addition in Unix nanoseconds.