TGViewer
Coding Interview Preparation Coding Interview Preparation @coding_interview_preparation · 5.9K subscribers
Post #1202 644
✅ Git & GitHub Interview Questions & Answers 🧑‍💻🌐 

1️⃣ What is Git? 
A:
Git is a distributed version control system to track changes in source code during development.

2️⃣ What is GitHub? 
A:
GitHub is a cloud-based platform that hosts Git repositories and supports collaboration, issue tracking, and CI/CD.

3️⃣ Git vs GitHub
- Git: Version control tool (local) 
- GitHub: Hosting service for Git repositories (cloud-based) 

4️⃣ What is a Repository (Repo)?
A:
A storage space where your project’s files and history are saved.

5️⃣ Common Git Commands:
- git init → Initialize a repo 
- git clone → Copy a repo 
- git add → Stage changes 
- git commit → Save changes 
- git push → Upload to remote 
- git pull → Fetch and merge from remote 
- git status → Check current state 
- git log → View commit history 

6️⃣ What is a Commit? 
A:
A snapshot of your changes. Each commit has a unique ID (hash) and message.

7️⃣ What is a Branch?
A:
A separate line of development. The default branch is usually main or master.

8️⃣ What is Merging? 
A:
Combining changes from one branch into another.

9️⃣ What is a Pull Request (PR)?
A:
A GitHub feature to propose changes, request reviews, and merge code into the main branch.

🔟 What is Forking?
A:
Creating a personal copy of someone else’s repo to make changes independently.

1️⃣1️⃣ What is .gitignore? 
A:
A file that tells Git which files/folders to ignore (e.g., logs, temp files, env variables).

1️⃣2️⃣ What is Staging Area? 
A:
A space where changes are held before committing.

1️⃣3️⃣ Difference between Merge and Rebase
- Merge: Keeps all history, creates a merge commit 
- Rebase: Rewrites history, makes it linear 

1️⃣4️⃣ What is Git Workflow?
A: A set of rules like Git Flow, GitHub Flow, etc., for how teams manage branches and releases.

1️⃣5️⃣ How to Resolve Merge Conflicts?
A:
Manually edit the conflicted files, mark resolved, then commit the changes.

💬 Tap ❤️ if you found this useful!
  • ❤ 2
More from @coding_interview_preparation
  1. Oct 12, 2026Java Coding Interview Questions Easy 1. Reverse a string without using a built-in reverse…
  2. Oct 10, 2026100 SQL interview questions
  3. Oct 8, 2026If you're prepping for system design interviews, this repo is gold It contains a curated,…
  4. Oct 6, 2026document post
  5. Oct 4, 2026💼 Why Your Resume Gets Rejected Before a Human Reads It You may have good skills and proj…
  6. Oct 2, 2026🧠 Coding Myths You Should Stop Believing There's a lot of advice online about learning to…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →