assert_
glossary ↓ downloads
track: java · selenium
suite 01 · tooling & environment

Git basics — version control for testers

Tooling & environment15 min
as a manual tester

You save copies: test-plan-v2-FINAL-really.xlsx.

in automation

Git replaces filename archaeology with real history: every change recorded, labeled, reversible.

Git tracks changes to files over time. Every automation job expects it, your code lives in it, and CI (Suite 07) is triggered by it. The good news: five commands cover 90% of daily use.

The mental model

A repository (repo) is a folder Git watches. You edit files, stage the changes you want to record, then commit them with a message — a labeled snapshot in permanent history. Push uploads your commits to a shared copy (GitHub); pull downloads teammates' commits.

terminal — the daily five
$ git init                        # make this folder a repo (once)
$ git status                      # what changed? (run constantly)
$ git add .                       # stage everything changed
$ git commit -m "Add login test"  # snapshot with a message
$ git push                        # upload to GitHub

Set up once

Install from git-scm.com (defaults are fine), create a free GitHub account, then introduce yourself to Git:

terminal
$ git config --global user.name  "Your Name"
$ git config --global user.email "you@example.com"

Commit messages are test documentation

"fixed stuff" helps no one. "Fix flaky wait in checkout test" tells the whole team what happened. Write messages like defect summaries — a skill you already have.

Branches, briefly: a branch is a parallel line of work — you'll develop tests on a branch and merge when green. IntelliJ has full Git support built in (the Commit and Git tabs), so you can do all of this without the terminal once you understand what the buttons mean.
⚠ when it breaks — the classics
Git says this isn't a repository
fatal: not a git repository (or any of the parent directories): .git

Fix: You're in the wrong folder, or git init never ran here. cd into the project folder and check with git status.

Git refuses to commit and asks who you are
Author identity unknown *** Please tell me who you are.

Fix: Run the two git config --global lines from this lesson (user.name and user.email) once, then commit again.

Push rejected on the first upload
! [rejected] main -> main (fetch first)  error: failed to push some refs

Fix: The GitHub repo has a commit yours doesn't (usually an auto-created README). Either create the repo empty next time, or run git pull origin main --rebase then push.

⚡ exercise · put your starter project under version control
  1. In a terminal, cd into your starter project folder.
  2. git init, then git add ., then commit with a meaningful message.
  3. Create an empty repo on GitHub named assert-stage-1, follow its "push an existing repository" two-liner.
  4. Refresh GitHub — your code is on the internet. That URL is the beginning of your automation portfolio.
key takeaways
  • init / status / add / commit / push cover daily Git.
  • Commits are labeled snapshots; write messages like defect summaries.
  • Your GitHub account doubles as your portfolio from day one.
← Set up your environment (Windows) Running tests from the terminal →