You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/admin/git-providers.md
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -90,3 +90,35 @@ To support regex matching for paths (e.g. github.com/orgname), you'll need to ad
90
90
```console
91
91
git config --global credential.useHttpPath true
92
92
```
93
+
94
+
##Require git authentication in templates
95
+
96
+
If your template requires git authentication (e.g. running`git clone` in the[startup_script](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script)), you can require users authenticate via git prior to creating a workspace:
97
+
98
+

99
+
100
+
The following example will require users authenticate via GitHub and auto-clone a repo
101
+
into the`~/coder` directory.
102
+
103
+
```hcl
104
+
data "coder_git_auth" "github" {
105
+
# Matches the ID of the git auth provider in Coder.
See the[Terraform provider documentation](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/git_auth) for all available options.