World map

 

BM: Baca dalam Bahasa Melayu

World 12: Career Quest

Git interview questions

You will learn: short, clear answers to four classic Git questions.

The problem

The interviewer smiles: “So, what is HEAD: Git's "you are here" marker.?” Your mind goes blank. Don’t panic. Show it instead.

Tap the commit HEAD points at.

6d3a9b1a8feb630e17b76

Watch

A new commit, Revert Add broken menu, appears at the end. All the older commits stay where they were.
6d3a9b1a8feb630e17b76

Question two: reset or revert? revert: Make a new commit that undoes an old one. adds a new commit that undoes an old one. Nothing is erased. So it is safe for shared work.

Predict

“Then when is reset the better choice?” Pick the answer you would give.

Pick one answer.

Try it

Question three: fetch or pull? fetch downloads the news but changes nothing. pull downloads it and joins it in. Sort each fact.

Drag a card into a box. Or tap the card, then tap the box.

      Predict

      Last one: “Merge or rebase?” Pick the clearest answer.

      Pick one answer.

      Check

      Interviewers love honest, careful habits. Judge each answer.

      Swipe right for good, left for needs work. Or use the buttons.

      1 / 6

      "I run git status before every commit."

      "I run `git status` before every commit."

      You did it!

      You can now answer four classic Git interview questions.

      Go deeper (optional)

      More classics: “What is a detached HEAD?” (World 2). “What does git stash do?” and “How do you fix a conflict?” (World 3). Practise each answer out loud, in two sentences. Then give a real example from your own project.