This doc has been deprecated in favor of using Named Profiles - A Named Profile gives users the ability to reference certain kinds of external sources, such as a private remote repository, when creating pipelines. The supported credentials are described in Types of credentials.
When using a private repo for Terraform modules - the git credentials need to be available for terraform in order to properly clone the modules repo. In other words, Terraform scripts that reference a private repo for the source of modules require git credentials.
e.g.
module "iam_user" {
source = "git::https://github.com/away168/private-terraform-modules.git//modules/iam-user"