.gitignore for Cloudflare Workers
5 ignore rules for Cloudflare Workers, ready to copy into your repository.
Serverless edge platform managed with Wrangler
The complete .gitignore for Cloudflare Workers
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-09-17 20:28:17 UTC
# Technologies: Cloudflare Workers
### Cloudflare Workers ###
# Cloudflare Workers local secrets
.dev.vars*
!.dev.vars.example
.env*
!.env.example
# Wrangler local state and build cache
.wrangler/
What these Cloudflare Workers rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
Wrangler project
| Pattern | What it ignores |
|---|---|
.dev.vars* |
Cloudflare Workers local secrets |
!.dev.vars.example |
Wrangler project |
.env* |
Wrangler project |
!.env.example |
Wrangler project |
.wrangler/ |
Wrangler local state and build cache |
How to use this .gitignore for Cloudflare Workers
- Copy the Cloudflare Workers 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.