27. How to Use Git with Jupyter Notebooks for Data Projects
27.6 Common Mistakes
Why. The cost of a bad Git habit shows up weeks later — leaked tokens, broken clones, unreadable history.
What.
- Committing
data/raw/full_extract.csv(huge). - Committing
.envwith API keys (Chapter 26). - Committing notebooks full of outputs every 5 minutes.
- Editing the same cell on two laptops without pull/push discipline.
- Putting passwords in notebook markdown “for later”.
How.
Pre-push checklist
git status— any.envor unexpected CSV?- Open diff — is it code or a giant output blob?
- Confirm README still says data is fictional if applicable.
- Confirm venv is not inside the repo commit.
- Ask: can a classmate clone and understand the next step?
Worked example A — Secret sniff (manual).
git grep -n "API_KEY\|password\|SECRET" || true
Worked example B — Size alarm.
git ls-files -s | sort -k2 -n | tail
(Or simply check file sizes in data/raw/ before git add.)
Worked example C — Checkpoint clutter.
.ipynb_checkpoints/ duplicates notebooks. Always ignore it.
Ravindra Bagale's Tip
Mote file, secret, noisy output — teen red flags. Checklist 30 seconds.