Mastering Git and GitHub in 2026: A Developer's Essential Toolkit
You know commit, push, and how to apologize in a pull request. Mastery is the next layer: keeping history linear before anyone reviews it, recovering from the mistakes that feel fatal, and leaving reviews that make code better instead of longer. None of it is hard. All of it is habit.
Rebase before you ask for review
Your branch started from Monday's main; it is Thursday now, and main moved. Rebasing replays your commits on top of the fresh tip, so reviewers see your change once, cleanly, instead of a merge-conflict museum:
git fetch origin
git rebase origin/main
Conflicts pause the replay; resolve each one, then continue. Two rules keep you safe: rebase is local hygiene — never rewrite a branch other people have already pulled — and if you must force-push, --force-with-lease fails politely instead of overwriting someone's new commits.
The reflog: almost nothing is truly lost
The day will come when a botched rebase or a panicky git reset --hard makes your work "disappear". Breathe. Git remembers every place HEAD has pointed:
git reflog
# a1b2c3d HEAD@{7}: rebase (abort) ...
# e4f5a6b HEAD@{8}: commit: feat: payment retries
git reset --hard HEAD@{8}
Find the moment before the disaster, reset to it or branch from it, and your work is back. Deleted branches, amended commits, most "I lost everything" moments — the reflog has been keeping receipts the whole time.
Reviews worth reading
Three habits upgrade a team's review culture fast. Review your own PR first, top to bottom — you will catch the leftover debug lines and save reviewers for real questions. Comment on the why, never the what: "uses a five-minute cache because the upstream API rate-limits" is context; "this fetches the user" is noise. And retire the bare LGTM — an approval should name one thing you actually verified, or it is a rubber stamp wearing a signature. When two engineers fundamentally disagree, do not let it fester for a week: one short call, decision documented in the thread, move on.
Close the loop from the terminal
gh pr checkout 432
gh pr merge --squash --delete-branch
gh run watch
gh release create v1.42.0 --generate-notes
Check out a colleague's PR locally, merge it squashed with the branch cleaned up, watch CI from the terminal, and cut a release with generated notes. Signed commits — an SSH key, or Sigstore's keyless gitsign — are worth switching on while you are at this level.
Git's whole design whispers a reassurance: history can be recovered, mistakes can be undone. I wish the world worked that way for everyone — the families of Gaza deserve a reflog of their own, a way back to what was taken. May they get it.
When something you thought was settled gets refused — a UK or Schengen visa file, say — we do the reflog thing for a living. HTG Travels reworks refused cases from Sialkot, finds what actually sank them, and re-files properly. Not everything lost is lost; it depends who is doing the looking.




