Skip to content
language13 active rulesVerified 2026-09-30

Go .gitignore Template

Go compiled binaries, test artifacts, and workspace configuration. Generated and merged deterministically with upstream GitHub repository patterns to keep your repository clean of package directories, temporary build artifacts, and local environment files.

Interactive Stack Generator

Preconfigured with Go
Search for templates
Quick add:
Selected1
Go
Selected Templates (1)
.gitignore
13 rules
### Go ###
# 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.*
*.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/
34 lines•UTF-8
Deterministic

Raw Go .gitignore

Crawlable upstream source template
go.gitignore•33 lines•UTF-8
# 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.*
*.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/

Key Pattern Breakdown

Build Outputs & Compiled Artifacts

Generated binary files, compilation targets, and distribution bundles that can be reliably reproduced from source.

*.exe*.exe~*.dll*.so*.out

Environment Secrets & Local Overrides

Local environment configurations, secrets, and credentials intended to protect developer-specific settings from exposure.

.env

Execution Caches & Runtime Logs

Diagnostic logs, runtime metadata, test coverage reports, and incremental compiler caches that cause noisy repository diffs.

coverage.*

Source & Verification

License: CC0-1.0

Place this file in the root directory of your project as .gitignore. Changes take effect on newly added or untracked files.