27. How to Use Git with Jupyter Notebooks for Data Projects
27.5 Commits, Remotes and Team Hygiene
Why. “ASDF” commit messages help nobody at 11 pm before a stakeholder call.
What.
- Small commits; present-tense or clear past messages.
git remoteoptional — GitHub backup when ready.- Never force-push secrets “to fix” a leaked key — rotate the key.
How.
Daily habit
git statusbefore you leave the desk.- Stage related files together (notebook + README note).
- Write message: what / why in one line.
- If using GitHub: push after local commit works.
- If a secret slipped in: rotate secret; remove from history with help — do not leave it active.
Worked example A — Good messages.
Add Nashik filter to delivered GMV notebook
Ignore raw csv zips in gitignore
Document fictional data caveat in README
Worked example B — Bad messages.
update
asdf
final
wip wip wip
Worked example C — Who commits what (fictional).
| Person | Commits |
|---|---|
| Shraddha | Cleaning notebook |
| Amir | Chart notebook + outputs/.gitkeep |
| Both | Review .gitignore before first push |
Ravindra Bagale's Tip
Treat a commit message like a note in your calendar: say what changed and why in one line, for example “Add Nashik filter to delivered GMV notebook”. Messages like “update” or “wip” do not help anyone next month, including you. Keep one idea per commit, and run git status before you leave your desk.
Ravindra Bagale's Tip – मराठी
Commit message ला calendar मधल्या note सारखं समजा: काय बदललं आणि का, ते एका ओळीत सांगा, उदाहरणार्थ “Add Nashik filter to delivered GMV notebook”. “update” किंवा “wip” सारखे messages पुढच्या महिन्यात कुणालाच उपयोगी पडत नाहीत, तुम्हालाही नाही. एका commit मध्ये एकच कल्पना ठेवा, आणि desk सोडण्याआधी git status चालवा.
Ravindra Bagale's Tip – हिंदी
Commit message को calendar के note की तरह समझो: क्या बदला और क्यों, यह एक line में बताओ, जैसे “Add Nashik filter to delivered GMV notebook”। “update” या “wip” जैसे messages अगले महीने किसी के काम नहीं आते, आपके भी नहीं। एक commit में एक ही बात रखो, और desk छोड़ने से पहले git status चलाओ।