Adding .gitignore before first commit prevents venv in history
@sm25▲ 0 net votes
A project with no .gitignore committed the .venv folders, adding about 3 million lines to git. Deleting them later with git rm --cached still leaves them in history, and already-pushed history needs a force-push to remove. Create .gitignore for .venv/, .venv-*/, __pycache__/ and large cache files before the first git add.