A repository (or repo) is a folder Git is tracking. Once a folder becomes a repo, every change inside it can be saved, named, branched, and recovered. There are exactly two ways to get one — create a fresh repo from scratch with git init, or copy an existing one from GitHub with git clone. As a QA engineer, you'll use clone far more often than init, but you should know both. This lesson walks through each, then introduces git status — the single most useful command in Git.
Path 1: starting fresh with git init
Use git init when you have a brand new project that has never been version-controlled. Open your terminal and run:
mkdir my-test-project
cd my-test-project
git initExpected output:
Initialized empty Git repository in /Users/you/my-test-project/.git/
Three things just happened: you made a folder, moved into it, and told Git "track this folder from now on." That last command created a hidden subfolder called .git.
The .git folder — Git's brain
Run ls -a (macOS/Linux/Git Bash) or dir /a (Windows CMD) to see hidden files:
ls -a. .. .git
That .git folder is where Git stores everything — every commit, every branch, every config, every saved snapshot. Treat it as untouchable. Never edit files inside .git by hand, never rm -rf .git, never copy it between projects. Deleting .git would erase the entire history of the project. The visible files are your project; .git is the database underneath.
Path 2: copying an existing repo with git clone
This is the path you'll take 95% of the time as a QA engineer. Your team already has a Cypress repo on GitHub; you need a local copy. Run:
git clone https://github.com/your-team/webapp-tests.git
cd webapp-testsExpected output:
Cloning into 'webapp-tests'...
remote: Enumerating objects: 482, done.
remote: Counting objects: 100% (482/482), done.
remote: Compressing objects: 100% (213/213), done.
Receiving objects: 100% (482/482), 1.24 MiB | 4.20 MiB/s, done.
Resolving deltas: 100% (215/215), done.
What just happened:
- Git contacted GitHub at the URL you gave it.
- It downloaded the entire project — every commit, every branch, every file, every byte of history.
- It made a folder named after the repo (
webapp-tests/) and put everything inside. - It set up a remote called
originpointing at the GitHub URL, so futurepullandpushcommands know where to talk to.
You now have the same code your teammates have, you can run the test suite locally, and you can work offline if you need to. That's the magic of distributed version control.
HTTPS vs SSH clone URLs
GitHub offers two flavours of clone URL:
# HTTPS — works everywhere, prompts for credentials on push
git clone https://github.com/team/webapp-tests.git
# SSH — silent authentication via your SSH key (covered in Chapter 3)
git clone git@github.com:team/webapp-tests.gitEither works for cloning a public repo. For private repos and pushing, SSH is the smoother experience long term — Chapter 3, Lesson 1 covers setting it up.
git status — the most useful command in Git
Run this any time you're not sure what's going on:
git statusIn a fresh git init repo it prints:
On branch main
No commits yet
nothing to commit (create/copy files and add "git add" to track)
Translation: you're on the main branch, you haven't made any commits, and there are no files to commit yet. Now create a file and run status again:
echo "# My Test Project" > README.md
git statusOn branch main
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
README.md
nothing added to commit but untracked files present (use "git add" to track)
Git noticed README.md exists but isn't tracked yet. The output literally tells you the next command (git add) — that's the pattern. Run git status whenever you're lost; it almost always points at the next step. The next lesson covers git add and git commit to move that file into history.
Choosing your path
A real QA scenario
Your team's Cypress test repo is at github.com/acme/checkout-tests. Your job today is to add a new test for a discount-code edge case. The opening sequence:
cd ~/projects
git clone https://github.com/acme/checkout-tests.git
cd checkout-tests
git statusgit status confirms a clean working tree:
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
You're now sitting on the latest version of the team's tests, with a clean slate to start work. Everything else in this course builds on this exact starting point.
⚠️ Common mistakes
- Running
git initinside a folder that's already a repo. Re-initialising doesn't break anything, but it's also pointless —git statuswould have told you the folder was already tracked. Always rungit statusfirst if you're not sure. - Cloning into the wrong parent directory.
git clonecreates a new folder inside whatever directory you're currently in. If your terminal is at~/Desktopand you clone, you get~/Desktop/webapp-tests/. Alwayspwdfirst if the destination matters. - Deleting
.gitto "clean up." Beginners sometimes spot the hidden folder, decide it looks weird, and delete it. The folder is the entire repository. Without it, you have a plain folder again — every commit, every branch, every history entry is gone. Treat.gitas off-limits.
🎯 Practice task
Hands-on with both paths. 20 minutes.
- Init path. In your terminal,
cdto a parent folder you like (e.g.,~/projects). Runmkdir qa-sandbox && cd qa-sandbox && git init. Confirm the success message and runls -ato see the.gitfolder. - Run
git status. Read the output line by line — note how Git tells you exactly what to do next. - Create a placeholder file:
echo "# QA Sandbox" > README.md. Rungit statusagain. Spot the difference —README.mdnow appears as untracked. - Clone path. Pick any small public Git project — for example
git clone https://github.com/octocat/Hello-World.git. Confirm the cloning output,cd Hello-World, and rungit statusandgit log --oneline | head. You're looking at the live history of someone else's project on your laptop. - Stretch: open the cloned folder in VS Code (
code .). The Source Control tab in the sidebar shows a Git icon — VS Code has detected the repo automatically.
You now have repos to work in. The next lesson teaches the heartbeat of every Git workflow: add, commit, push.