Interview Q&A / Git & GitHub
Git & GitHub interview questions
Branching, merge vs rebase, resolving conflicts and pull requests, the way teams actually work.
Prefer rapid revision? Practise Git & GitHub short interview answers →
- What does git merge --squash do?
It combines all changes from a branch into the working tree and staging area as one set of changes, without creating a merge commit. You then commit once, so the branch's many commits become a single commit on main.
IntermediateQuick answer1 min read - What is the difference between squash and fixup in an interactive rebase?
Both merge a commit into the one above it. squash lets you combine and edit the two commit messages, while fixup silently discards the second message and keeps the first as it is.
IntermediateQuick answer1 min read