Skip to content

Update Python.gitignore to include .env.example - #4894

Open
Axwaizee wants to merge 1 commit into
github:mainfrom
Axwaizee:patch-1
Open

Update Python.gitignore to include .env.example#4894
Axwaizee wants to merge 1 commit into
github:mainfrom
Axwaizee:patch-1

Conversation

@Axwaizee

Copy link
Copy Markdown

Add exception for .env.example in gitignore

Link to the application or project's homepage

https://github.com/github/gitignore

Reasons for making this change

The Python.gitignore template ignores .env files (since they typically hold secrets like API keys and database credentials). However, this same rule also matches .env.example, a template file that intentionally contains no secrets and is meant to be committed to the repo so other contributors know which environment variables to set up. Right now, anyone who creates a .env.example file has it silently ignored and has to manually force-add it or edit their .gitignore. Adding a negation rule (!.env.example) keeps .env ignored while explicitly un-ignoring the safe example file, matching common convention (e.g. .env.example, .env.sample) used across many Python projects.

Links to documentation supporting these rule changes

Merge and Approval Steps

Add exception for .env.example in gitignore
@Axwaizee
Axwaizee requested a review from a team as a code owner August 10, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant