···17171818# Template Repositories
19192020-Gitea `1.11.0` and above includes template repositories, and one feature implemented with them is auto-expansion of specific variables within your template files.
2020+Gitea (starting with version `1.11.0`) supports creating template repositories
2121+which can be used to generate repositories based on the template, complete with
2222+variable expansion of certain pre-defined variables.
21232222-To tell Gitea which files to expand, you must include a `template` file inside the `.gitea` directory of the template repository.
2424+All files in the template repository are included in a generated repository from the
2525+template except for the `.gitea/template` file. The `.gitea/template` file tells
2626+Gitea which files are subject to the variable expansion when creating a
2727+repository from the template.
23282429Gitea uses [gobwas/glob](https://github.com/gobwas/glob) for its glob syntax. It closely resembles a traditional `.gitignore`, however there may be slight differences.
2530···2833All paths are relative to the base of the repository
29343035```gitignore
3131-# All .go files, anywhere in the repository
3636+# Expand all .go files, anywhere in the repository
3237**.go
33383439# All text files in the text directory
···4045# Batch files in both upper or lower case can be matched
4146**.[bB][aA][tT]
4247```
4343-4444-**NOTE:** The `template` file will be removed from the `.gitea` directory when a repository is generated from the template.
45484649## Variable Expansion
4750