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
π¬ Tap β€οΈ for more!
Top comments (0)