### 防止提交垃圾文件

Each filename contained in a Git push is compared to the regular expression in this field. Filenames in Git consist of both the file’s name and any directory that may precede it. A singular regular expression can contain multiple independent matches used as exclusions. File names can be broadly matched to any location in the repository, or restricted to specific locations. Filenames can also be partial matches used to exclude file types by extension.

Example: combining all of the above in a single expression. The preceding expressions rely on the end-of-string character $. We can move that part of each expression to the end of the grouped collection of match conditions where it is appended to all matches:


```text
(\.exe|^config\.yml|^directory-name\/config\.yml|(^|\/)install\.exe)$
```

https://docs.gitlab.com/ee/user/project/repository/push_rules.html#prohibited-file-names

![GitLab push rules branch name](./prevent-rubbish-files.png)
