✅ *Git & GitHub Interview Questions & Answers(Prt 2)* 🧑‍💻🌐
ssekabira robert sims

ssekabira robert sims @ssekabirarobertsims

About: SOFTWARE ENGINEER

Location:
Kampala, Uganda
Joined:
Dec 17, 2024

✅ *Git & GitHub Interview Questions & Answers(Prt 2)* 🧑‍💻🌐

Publish Date: Nov 12
5 0

1️⃣6️⃣ What is a Tag in Git?

A: A tag marks a specific point in history, often used for releases (e.g., v1.0).

1️⃣7️⃣ Difference between Soft, Mixed, and Hard Reset?

  • git reset --soft → Moves HEAD, keeps changes staged
  • git reset --mixed (default) → Moves HEAD, unstages changes
  • git reset --hard → Removes all changes

1️⃣8️⃣ What is Git Revert?

A: Reverts a commit by creating a new one that undoes changes, keeping history intact.

1️⃣9️⃣ What is Cherry Pick?

A: Apply a specific commit from one branch to another without merging the whole branch.

2️⃣0️⃣ What is Git Stash?

A: Temporarily saves uncommitted changes so you can switch branches safely.

2️⃣1️⃣ What is HEAD in Git?

A: A pointer to the current branch reference or latest commit in your working directory.

2️⃣2️⃣ What is the difference between origin and upstream?

  • origin: Default remote repo you cloned from
  • upstream: Original repo you forked from (used in collaboration)

2️⃣3️⃣ What is Fast-forward Merge?

A: When no divergence, Git just moves the branch pointer forward — no new commit needed.

2️⃣4️⃣ Git Fetch vs Git Pull

  • Fetch: Downloads changes without merging
  • Pull: Fetch + Merge in one step

2️⃣5️⃣ How to Undo Last Commit?

git reset --soft HEAD~1   # Keeps changes staged
git reset --hard HEAD~1   # Discards changes completely
Enter fullscreen mode Exit fullscreen mode

💬 Tap ❤️ for more!

Comments 0 total

    Add comment