Branch
// Definition
An independent line of development in a Git repository — a movable pointer to a commit, letting you work on a feature or fix in isolation without touching the main line. Branches are cheap and disposable; the typical flow is branch off `main`, commit work, open a pull request, merge back.
// Why it matters
Branching is how QA work stays isolated and reviewable — test changes, fixtures, and CI tweaks live on a branch until they're proven, so a broken test never lands on main directly. Understanding branches is also prerequisite to reading PRs, resolving conflicts, and knowing which code a test run actually exercised.
// How to test
git branch feature/login-tests # create git switch feature/login-tests # move onto it # ...commit test work in isolation... git switch main # main is untouched until you merge
// Common mistakes
- Working directly on
mainso unreviewed changes ship straight to everyone - Long-lived branches that drift far from
main(painful merges later) - Forgetting which branch you're on and committing to the wrong line
// Related terms
Commit
A saved snapshot of changes in a Git repo, with a message describing what changed and a unique hash identifying it. Commits are the atomic unit of history — each one is a revertible, reviewable point you can return to. Good commits are small and focused; the message explains why, not just what.
Pull Request
A proposed set of commits opened for review before merging into a shared branch — the gate where code is reviewed, CI runs, and approval happens. Called a Merge Request on GitLab. The PR is where automated tests, linting, and human review converge before code reaches `main`.
Merge Conflict
A state Git enters when two branches modify the same part of a file in incompatible ways and cannot be automatically combined. Git marks the conflict with `<<<<<<<`, `=======`, and `>>>>>>>` markers and waits for a developer to choose which version (or a manual combination) should survive. Merge conflicts are most common on long-lived feature branches or when several people edit the same test file simultaneously.