27. How to Use Git with Jupyter Notebooks for Data Projects
27.7 Practice, Tip and Close
Why. Muscle memory beats a long Git manual for analysts.
What. Initialize a tiny lab repo and make two clean commits.
How.
Chapter practice lab
- Create
blinkit_mh_lab/with the folder layout and README (fictional data note). - Add the starter
.gitignorefrom 27.3. - Put a tiny
data/raw/sample_orders.csv(5–10 rows) and a notebook pathnotebooks/01_clean.ipynb(even an empty notebook file is fine to start). git init, first commit: “Initial lab skeleton”.- Clear outputs if you ran cells; second commit: “Add sample orders and clean stub”.
- Run the pre-push checklist; write three bullets you would tell a teammate.
mkdir -p blinkit_mh_lab/{data/raw,data/clean,notebooks,outputs}
cd blinkit_mh_lab
printf '%s\n' '# Blinkit MH lab (fictional sample data)' > README.md
printf '%s\n' '.ipynb_checkpoints/' '.venv/' 'venv/' '.env' 'data/raw/*.csv' '!data/raw/sample_orders.csv' > .gitignore
printf '%s\n' 'order_id,city,amount_inr' 'BLK-1,Pune,189' 'BLK-2,Nashik,95' > data/raw/sample_orders.csv
printf '%s\n' '{"cells":[],"metadata":{},"nbformat":4,"nbformat_minor":5}' > notebooks/01_clean.ipynb
git init
git add README.md .gitignore data/raw/sample_orders.csv notebooks/01_clean.ipynb
git commit -m "Initial lab skeleton with sample orders"
Practice task
Raja: “Show git status clean after commit, and prove data/raw/huge.csv would be ignored by creating an empty huge.csv name and confirming it is untracked.” No real secrets.
Ravindra Bagale's Tip
Skeleton → gitignore → small commits → clear outputs. Password Kadhi nahi. Samajla ka?
Thodkyaat sangaycha tar (quick recap)
- Git replaces
final_v3filename chaos - Layout: raw / clean / notebooks / outputs
.gitignorebefore big adds- Clear notebook outputs for readable diffs
- Commit messages with a clear what/why
- Never commit secrets or multi-GB extracts
Samajla ka? Aata Jupyter lab Git sobat neat rahnar — pudhe ek chhota commit / evening.