Starting From a Synced master
git switch master
git pull
Real discipline starts here — never branch from a master that might already be behind.
Real, Separate Commits
git switch -c feature/pantry-checklist
# ... three genuinely separate commits ...
git push -u origin feature/pantry-checklist
Three commits, each describing exactly what it added — not one lump "add checklist" commit.
Merging With --no-ff
git switch master
git merge --no-ff feature/pantry-checklist -m "Merge pull request: pantry checklist"
git push
--no-ff forces a real merge commit even when a fast-forward would have been possible — a genuine, permanent record that this feature was reviewed and merged as a deliberate event, not silently absorbed into master's linear history.
Cleaning Up Immediately
git branch -d feature/pantry-checklist
git push origin --delete feature/pantry-checklist
Both copies, gone the moment the feature is safely merged — no stale branch left for anyone to wonder about later.
A real pantry checklist needs writing. This lesson performs the entire real lifecycle a disciplined feature branch workflow requires: sync master first, branch, commit in genuinely separate, meaningful steps, push, get it reviewed, merge it in a way that leaves a real record of the merge, then clean up immediately — both the local and the remote copy of the branch.
Real teams that skip the cleanup step accumulate exactly the mess Lesson 2.2.4 will clean up later. Doing it right the first time, every time, is the actual discipline this block is about.
git merge --no-ff
Forces a real merge commit even when the branch could otherwise fast-forward cleanly. Confirmed directly in this lab: "Merge made by the 'ort' strategy" appeared even though a fast-forward was technically possible, leaving a permanent, real record of when this feature was integrated.
git push origin --delete <branch>
Removes a branch from the remote entirely — the real remote counterpart to git branch -d for a local branch. Confirmed directly in this lab producing a real "[deleted]" line in the push output.
Takeaways
- Sync master before branching — never build new work on a branch point that might already be stale
- Real, separate commits describe exactly what each one added — never one lump "did the feature" commit
- git merge --no-ff creates a genuine, permanent record of when a feature was reviewed and integrated
- Clean up both the local AND remote branch the moment a feature is safely merged — never leave either behind