← All files

GO .GITIGNORE

GitHub’s official Go .gitignore template.

[ DOWNLOAD ][ MARKDOWN ][ SOURCE ]

GitHub’s official Go .gitignore template. It is maintained in GitHub’s public template collection and released under CC0-1.0.

USE

  • Copy it to the repository root as .gitignore.
  • Merge it with project-specific patterns; later patterns take precedence.
  • Commit the result so every contributor uses the same rules.

NOTES

  • The template is a starting point; remove patterns you do not need.
  • Generated files should usually stay untracked.

SOURCE

https://github.com/github/gitignore/blob/main/Go.gitignore

FULL TEXT

[ DOWNLOAD ]
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Code coverage profiles and other test artifacts
*.out
coverage.*
!coverage.go
*.coverprofile
profile.cov

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
go.work.sum

# env file
.env

# Editor/IDE
# .idea/
# .vscode/

VERIFY SHA-256

Download the file, then choose it here. The checksum is compared locally in your browser.

Expected 16c7d7ad8c23ef27ccc8fe3c605752024a4d353f7e0b745defad7e6b0430b719

CITE

GO .GITIGNORE (v1.0, 2026-11-04). Original. https://original.wales/files/gitignore-go/ SHA-256: 16c7d7ad8c23ef27ccc8fe3c605752024a4d353f7e0b745defad7e6b0430b719. Source: https://github.com/github/gitignore/blob/main/Go.gitignore.

← All files