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 →
- How do you change the message or contents of your last commit?
Use git commit --amend. It replaces the last commit with a new one, letting you edit the message and include newly staged changes. Because it rewrites history, avoid it on commits you have already pushed and shared.
BeginnerQuick answer1 min read