DevOps Engineer · Step 3 of 8 · 8 min
Git and code review
Use branches, commits and pull requests the way teams do, and review changes usefully.
01 · Git is the record of every change
Git tracks every change to code and configuration: who changed what, when and why. In DevOps, everything that defines a system should live in Git, including infrastructure and pipeline files. If it is not in Git, it is hard to review, repeat or roll back.
02 · The daily loop
Clone a repository, create a branch, make a small change, commit it with a clear message, push it, and open a pull request. Others review it, automated checks run, and it is merged into the main branch.
Keep commits small and messages useful: what changed and why, not just fix. Learn git status, git diff, git log, and how to resolve a merge conflict calmly.
03 · Reviewing well
Code review catches bugs, spreads knowledge and keeps standards consistent. Good reviews ask: does this do what it says, what could break, is it tested, and could someone else run it in a year.
Be kind and specific. Comment on the code, not the person. Small pull requests get better reviews; a change of 2,000 lines usually gets a quick approval and no real review.
04 · Protect the main branch
Most teams require a review and passing checks before anything merges to main. Turn this on in your own projects too. Never commit passwords or keys; once pushed, assume they are public and revoke them.