TGViewer
Coding Projects Coding Projects @programming_experts · 68K subscribers
Post #2473 3.89K
✅ 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—it's local-first, so you work offline and sync later. Pro tip: Unlike SVN, it snapshots entire repos for faster history rewinds.

2️⃣ What is GitHub?
A: GitHub is a cloud-based platform that hosts Git repositories and supports collaboration, issue tracking, and CI/CD via Actions. Example: Use it for pull requests to review code before merging—essential for open-source contribs.

3️⃣ Git vs GitHub
⦁ Git: Version control tool (local) for branching and commits.
⦁ GitHub: Hosting service for Git repositories (cloud-based) with extras like wikis and forks. Key diff: Git's the engine; GitHub's the garage for team parking!

4️⃣ What is a Repository (Repo)?
A: A storage space where your project’s files and history are saved—local or remote. Start one with git init for personal projects or clone from GitHub for teams.

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
Bonus: git branch for listing branches—practice on a sample repo to memorize.

6️⃣ What is a Commit?
A: A snapshot of your changes. Each commit has a unique ID (hash) and message—use descriptive msgs like "Fix login bug" for clear history.

7️⃣ What is a Branch?
A: A separate line of development. The default branch is usually main or master—create feature branches with git checkout -b new-feature to avoid messing up main.

8️⃣ What is Merging?
A: Combining changes from one branch into another—use git merge after switching to target branch. Handles conflicts by prompting edits.

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

🔟 What is Forking?
A: Creating a personal copy of someone else’s repo to make changes independently—then submit a PR back to original. Common in open-source like contributing to React.

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

1️⃣2️⃣ What is Staging Area?
A: A space where changes are held before committing—git add moves files there for selective commits, like prepping a snapshot.

1️⃣3️⃣ Difference between Merge and Rebase
⦁ Merge: Keeps all history, creates a merge commit—preserves timeline but can clutter logs.
⦁ Rebase: Rewrites history, makes it linear—cleaner but riskier for shared branches; use git rebase main on features.

1️⃣4️⃣ What is Git Workflow?
A: A set of rules like Git Flow (with develop/release branches) or GitHub Flow (simple feature branches to main)—pick based on team size for efficient releases.

1️⃣5️⃣ How to Resolve Merge Conflicts?
A: Manually edit the conflicted files (look for <<<< markers), then git add resolved ones and git commit—use tools like VS Code's merger for ease. Always communicate with team!

💬 Tap ❤️ if you found this useful!
  • ❤ 10
  • 👏 1
More from @programming_experts
  1. Oct 9, 2026🇮🇳 𝗚𝗢𝗩𝗘𝗥𝗡𝗠𝗘𝗡𝗧 𝗢𝗙 𝗜𝗡𝗗𝗜𝗔 — 𝗔𝗜𝗖𝗧𝗘 𝗜𝗡𝗧𝗘𝗥𝗡𝗦𝗛𝗜𝗣𝗦 𝟮𝟬𝟮𝟲 🚀…
  2. Oct 8, 2026🎓 𝗠𝗶𝗰𝗿𝗼𝘀𝗼𝗳𝘁 𝗙𝗥𝗘𝗘 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝘄𝗶𝘁𝗵 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗲𝘀! 🚀🔥 Upgr…
  3. Oct 7, 2026🧩Now, Let's Understand Functions in Programming 👨‍💻🔥 After variables, operators, condi…
  4. Oct 7, 2026🚀𝗣𝗮𝘆 𝗔𝗳𝘁𝗲𝗿 𝗣𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 𝗧𝗿𝗮𝗶𝗻𝗶𝗻𝗴 | 𝗕𝗲𝗰𝗼𝗺𝗲 𝗮 𝗙𝘂𝗹𝗹𝘀𝘁𝗮𝗰…
  5. Oct 7, 2026𝗠𝗮𝘀𝘁𝗲𝗿 𝗣𝗼𝘄𝗲𝗿 𝗕𝗜 𝗳𝗼𝗿 𝗙𝗥𝗘𝗘! 🔥 Learn Power BI through these FREE learnin…
  6. Sep 29, 2026Post #2901
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 →