Ravindra BagaleCourses & study guides मराठी Track your progress

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 .env with 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

  1. git status — any .env or unexpected CSV?
  2. Open diff — is it code or a giant output blob?
  3. Confirm README still says data is fictional if applicable.
  4. Confirm venv is not inside the repo commit.
  5. 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.