.gitignore for Go Allow List
8 ignore rules for Go Allow List, ready to copy into your repository.
Go language allow list patterns
The complete .gitignore for Go Allow List
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:33:50 UTC
# Technologies: Go Allow List
### Go Allow List ###
*
!/.gitignore
!*.go
!go.sum
!go.mod
!README.md
!LICENSE
!*/
What these Go Allow List rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
Ignore everything
| Pattern | What it ignores |
|---|---|
* |
Ignore everything |
But not these files...
| Pattern | What it ignores |
|---|---|
!/.gitignore |
But not these files... |
!*.go |
But not these files... |
!go.sum |
But not these files... |
!go.mod |
But not these files... |
!README.md |
But not these files... |
!LICENSE |
But not these files... |
!*/ |
...even if they are in subdirectories |
How to use this .gitignore for Go Allow List
- Copy the Go Allow List rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.