Version Control and Development Tooling
The Version Control and Development Tooling domain tests everyday Git fluency - the three trees, branching, history rewriting - plus the package and build tooling around a modern front-end project.
The three trees
Git tracks the working tree, the index (staging area) and the repository of commits. git diff shows unstaged changes, git diff --staged what the next commit would capture. Commits are snapshots identified by a content hash; branches are movable refs and HEAD points at the current one.
Branching and integrating
git switch -c feature creates and moves to a branch. merge preserves history and may fast-forward; rebase replays commits onto a new base, giving a linear history but new hashes - never rebase a branch other people have pulled. Conflicts are marked with <<<<<<<, =======, >>>>>>>; resolve, git add, then continue.
Undoing
git restore <file> discards working-tree edits, git restore --staged unstages, and git reset --soft|--mixed|--hard moves the branch pointer with increasing destructiveness. git revert adds an inverse commit and is the safe option on shared branches; git commit --amend rewrites the last commit.
Worked example
You committed to main by mistake. git branch feature points a new ref at the current commit, git reset --hard origin/main moves main back, and git switch feature recovers the work - but --hard also discards uncommitted changes, so commit or stash first.
Tooling
package.json scripts drive build, lint and test. Semver ^1.4.2 allows minor and patch updates, ~1.4.2 patch only, and the lockfile pins exact resolved versions. ESLint finds problems, Prettier formats, bundlers such as Vite transform and split code, and .gitignore only affects untracked files.
Traps
Committing node_modules or secrets, expecting .gitignore to untrack an already-tracked file, and running git pull with uncommitted changes.