AI Hints
Home›Git & GitHub Tutorial›Quick-Fire Quiz
Git & GitHub · Lesson 141 of 144

Quick-Fire Quiz: Round Two

Harder questions.

⏱ 2 min read▶ Video at 2:36:14🎓 Free
Watch this lesson in the Git & GitHub courseWatch on YouTube ↗Full Git & GitHub course

Round two. These are a little harder, and they cover undoing, rebasing and teamwork.

Quick-Fire Quiz: Round Two
From the video: Quick-Fire Quiz: Round Two
  • Round two
  • A little harder
  • Undo, rebase, teamwork

Question 6

You committed a typo in the message, and haven't pushed. Fastest fix? Git commit dash dash amend, git revert, or git reset dash dash hard? The answer is amend. It replaces the last commit, which is fine before sharing.

Quick check
Typo in the last commit message, not pushed. Fastest fix?

Question 7

A bad commit was pushed to main last week, and everyone has it. How do you undo it? Git reset dash dash hard, git revert, or interactive rebase? The answer is revert. It adds a new commit, and doesn't rewrite shared history.

Quick check
Undo a bad commit everyone already has?

Question 8

You ran git reset dash dash hard, and lost a commit you needed. Where can you find it? In git log, in git reflog, or nowhere, it's gone? The answer is git reflog. It remembers where head has been.

Quick check
A commit vanished after reset --hard. Where do you look?

Question 9

What does git pull do? Only downloads commits, fetches and then merges, or uploads your commits? The answer is fetch, then merge. Fetch alone only downloads, and push uploads.

Quick check
What does git pull do?

Question 10

Which commits should you never rebase? Commits on your own feature branch, commits that only exist on your computer, or commits that others have already pulled? The answer is commits others already have. That's the golden rule of rebase.

Quick check
Which commits should you never rebase?

Summary

Ten questions. If you got most of them right, you really know Git. Next, a cheat sheet of everything, in one place.

Key takeaways
  • amend before sharing
  • revert after sharing
  • Never rebase shared commits
Next up: The Git Cheat Sheet — everyday commands