A day in the life
Intermediate
Why this matters
You now know every command and every page. This lesson puts them in order, once, as a day actually goes. If you follow it for your first few changes, the sequence becomes automatic and you stop thinking about Git at all, which is the goal.
The whole day
Morning
1. Pick up the issue
Assign it to yourself, so nobody duplicates the work, and read it twice. If anything is ambiguous, ask in the issue rather than in chat: the answer then lives where the next person will look (lesson 13.9).
2. Start from current main
$ git switch main
$ git pullBranching from a stale main is the most common cause of conflicts later (lesson 11.6).
3. Make the branch
$ git switch -c docs/12-windows-install-stepsThe issue number in the name is what links the branch, the commits and the merge request together (lesson 6.2). Many teams start the branch from the issue page instead, which names it for you.
4. Do the work
One thing at a time. If you notice something else that needs fixing, write it down as a new issue rather than adding it here: a merge request about two things takes twice as long to review and is twice as likely to be sent back.
Midday
5. Check it yourself
Read .gitlab-ci.yml or .github/workflows/*.yml and run what the pipeline runs:
$ npx --yes markdownlint-cli "**/*.md" --ignore node_modules
$ python3 -m unittest discover -s tests -vTen seconds here saves a ten-minute round trip later (lesson 9.10).
6. Commit
$ git status
$ git add docs/getting-started.md
$ git diff --staged
$ git commit -m "docs: add Windows steps to installation guide (#12)"git diff --staged before every commit is the habit that catches the debugging line you left in.
7. Push
$ git push -u origin docs/12-windows-install-stepsThe output contains the link to open the merge request, which saves finding it in the interface.
8. Open it as a draft
Title, then a description with what, why, how to check and Closes #12. Add reviewers. Mark it a draft while you are still working (lesson 9.7).
Opening early is deliberate: the pipeline starts running, and a colleague can say "that is the wrong file" before you have spent the afternoon on it.
Afternoon
9. The pipeline and the review
The pipeline runs on every push. If it is red, open the failing job, read upwards from the end of the log, and fix what it names.
Review comments arrive as threads. Answer every one, even with "done" or "kept as is, because…" (lesson 9.8).
10. Push fixes
$ git add docs/getting-started.md
$ git commit -m "docs: address review comments on the Windows steps"
$ git pushNew commits, not amends: the reviewer needs to see what changed since they looked. The squash on merge tidies it up.
Then Mark as ready, and re-request review.
11. Approve and merge
When the pipeline is green and the approvals are in, merge with the option your team uses, ticking Delete source branch (lesson 13.4). The issue closes itself, because the description said Closes #12.
12. Clean up
$ git switch main
$ git pull
$ git fetch --prune
$ git branch -d docs/12-windows-install-stepsThirty seconds, and it keeps your branch list meaningful. Then pick up the next issue.
The same day on GitHub
Identical, with four words changed:
| GitLab | GitHub |
|---|---|
| Merge request | Pull request |
| Pipeline | Checks, run by Actions |
| Changes tab | Files changed tab |
| Mark as ready | Ready for review |
The commands do not change at all (terminology map).
What the day is actually made of
Of the twelve steps, two are your work: step 4 and step 10. The other ten are the same every time, which is exactly why they are worth turning into a routine rather than a decision. Experienced people do not think faster about steps 2, 3, 7 and 12; they do not think about them at all.
How to do it
The whole day as commands, in order:
$ git switch main && git pull
$ git switch -c docs/12-windows-install-steps
$ git status && git add <file> && git diff --staged
$ git commit -m "docs: … (#12)"
$ git push -u origin HEAD
$ git commit -am "docs: address review comments" && git push
$ git switch main && git pull && git fetch --prune
$ git branch -d docs/12-windows-install-stepsgit push -u origin HEAD is worth knowing: HEAD means "the branch I am on", so the command is the same every time.
The same day without the terminal: the branch name in the status bar switches and creates branches, the Source Control view stages and commits, Publish Branch pushes, and the GitLab or GitHub extension opens and reviews the merge request. Sync is pull and push together.
Git → Update Project for step 2, the branch widget for step 3, the Commit tool window for step 6, Push for step 7, and the Merge Requests or Pull Requests window for steps 8 to 11.
- Plan → Issues: assign the issue to yourself.
- On the issue, Create merge request to get a correctly named branch and a draft.
- Work locally, push, and watch the pipeline on the merge request.
- Answer threads, apply suggestions, push fixes.
- Mark as ready, merge with Delete source branch, and check the issue closed.
The same sequence: assign the issue, create a branch from its Development section, push, open a draft pull request, watch Checks, answer reviews, Ready for review, Squash and merge, Delete branch.
Common mistakes
- Branching from a stale
main, which produces avoidable conflicts. - Committing to
mainby habit (lesson 12.7). - Two unrelated changes in one merge request.
- Waiting until the work is perfect to open the merge request. Open a draft early.
- Not running the pipeline's own commands locally.
- Leaving the branch behind after merging, so everyone's branch list grows.
Try it yourself
Goal: run the whole day once, deliberately.
- On your practice project, create an issue for a small documentation improvement.
- Follow all twelve steps above in order, without skipping the ones that feel unnecessary.
- Time yourself: note how long steps 4 and 10 take, and how long everything else takes.
- At the end, confirm:
mainup to date, branch gone locally and remotely, issue closed. - Write down any step you had to look up. That is your list for next time.
Expected result: one merged change, a clean local repository, and a short list of the steps that are not yet automatic for you.
Show solution
Step 3 is the point of the exercise. The ratio is usually four or five to one in favour of the actual work, and the overhead shrinks with practice while the work does not. That is worth knowing when the process feels heavy on your first few changes.