简体   繁体   中英

How do I refer to a specific branch of a private git repo in Terragrunt?

I want to refer to a feature/IaC (any specific branch other than the main) branch of a multibranch private git repo as a source parameter of Terragrunt's configuration file .

Here is a piece of code from my terragrunt.hcl file

terraform {
 source = "what_link_to_put_here?"
}

Thanks in advance.

As official docs said :

By default, Terraform will clone and use the default branch (referenced by HEAD) in the selected repository. You can override this using the ref argument. The value of the ref argument can be any reference that would be accepted by the git checkout command, such as branch , SHA-1 hash (short or full), or tag names. The Git documentation contains a complete list.

So:

source = "git::https://example.com/vpc.git?ref=xxx"  //xxx is a branch name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM