2.10 Lab — three meaningful commits
Lab
Build a tiny hello API repo for Instagram-style badge API . Use Python or Node — your choice.
git initin a new folder (or clonedevops-shipit-labsand create a subfolder).- Commit 1: add the hello app file that returns a simple response.
- Commit 2: add
.gitignore(include.env, dependency folders,*.pem). - Commit 3: add
README.mdwith how to run the app locally in five lines or fewer. - Show
git log --oneline— you should see three clear messages. - Create a local
.envwith a fake secret and confirmgit statusignores it.
Optional: git clone your empty GitHub devops-shipit-labs and push when you know git remote / git push from the next chapter or a short GitHub guide. If push is new, stop after local commits — that still completes this lab.
Practice task
List three files that should almost never be committed in a web API project, and the .gitignore pattern for each.
Thodkyaat sangaycha tar
- Git stores history; GitHub hosts it — they are not the same thing.
- Flow: working tree →
git add(staging) →git commit→git log. - Always
git statusbeforegit add .; use.gitignorefor.env, keys, dependencies. git restorefor safe local undo; amend only if not pushed to a shared branch.- Commit messages: short, imperative, one clear idea — three good commits beat one messy dump.
Samajla ka? Nasel tar staging area (2.5) aani .gitignore (2.6) punha vacha – status baghtun add karaychi savay lavun ghya. Aata pudhe jaauya branching, merge aani GitHub pull requests.