.gitignore for virtualenv
10 ignore rules for virtualenv, ready to copy into your repository.
Python virtual environment tool
The complete .gitignore for virtualenv
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:28:10 UTC
# Technologies: virtualenv
### virtualenv ###
# Python version marker
.Python
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
# Python virtual environment
.venv
pip-selfcheck.json
What these virtualenv rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
General
| Pattern | What it ignores |
|---|---|
.Python |
Python version marker |
[Bb]in |
General |
[Ii]nclude |
General |
[Ll]ib |
General |
[Ll]ib64 |
General |
[Ll]ocal |
General |
[Ss]cripts |
General |
pyvenv.cfg |
General |
.venv |
Python virtual environment |
pip-selfcheck.json |
General |
How to use this .gitignore for virtualenv
- Copy the virtualenv 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.