terraform
terraform copied to clipboard
Git depth example
Terraform Version
main
Affected Pages
https://github.com/hashicorp/terraform/blob/0c509183d165c2d317a9e27e31c0a213f4cb3cdd/website/docs/language/modules/sources.mdx#L263
What is the docs issue?
It would be nice with an example of what is meant by The
depth URL argument
.
Proposal
Something like
source = "git::https://example.com/vpc.git?depth=1&ref=v1.2.0"
References
No response
Thanks for this request!
The issue sounds good as it makes sense to include an example to make people understand the shallow clones.
The depth URL argument mentioned in the statement corresponds to the --depth
argument of the git clone
command. By specifying the depth parameter in the URL when cloning a repository, you instruct Git to create a shallow clone with the commit history truncated to only the specified number of commits.
For example, if you want to perform a shallow clone with only the last 3 commits of a repository, you would use the depth=3 parameter in the clone URL. This would fetch only the most recent 3 commits along with the necessary data, making the clone faster and more efficient, especially for large repositories.
I can fix the documentation
Opened the PR# https://github.com/hashicorp/terraform/pull/34692
Closed by https://github.com/hashicorp/terraform/pull/34692
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.