Friday, December 5, 2025

Git & GitHub Interview Questions & Answers


 


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.

About the Author : Anurag Pandey | Database cloud Architect | Oracle | SQL Server | PostgreSQL | AI and Data Platform Enthusiast

Anurag Pandey is a Database Architect with expertise in Oracle, PostgreSQL, SQL Server, Linux, and enterprise database platforms and specializes in database architecture, performance tuning, high availability, disaster recovery, cloud modernization, and operational excellence. With extensive experience in enterprise-scale environments, Anurag is passionate about leveraging AI, automation, and modern data platforms to improve reliability, scalability, and business outcomes. He actively contributes to technical communities through knowledge sharing, architecture guidance, and thought leadership in database and data engineering domains.

Follow more articles at

Visit Blog

Best AI Tool for Software Developer - SD 1,2,3,4,5,6.......


About the Author : Anurag Pandey | Database cloud Architect | Oracle | SQL Server | PostgreSQL | AI and Data Platform Enthusiast

Anurag Pandey is a Database Architect with expertise in Oracle, PostgreSQL, SQL Server, Linux, and enterprise database platforms and specializes in database architecture, performance tuning, high availability, disaster recovery, cloud modernization, and operational excellence. With extensive experience in enterprise-scale environments, Anurag is passionate about leveraging AI, automation, and modern data platforms to improve reliability, scalability, and business outcomes. He actively contributes to technical communities through knowledge sharing, architecture guidance, and thought leadership in database and data engineering domains.

Follow more articles at

Visit Blog

Oracle 19c to PostgreSQL 15 Migration: Step-by-Step Production Guide (Ora2Pg + DMS)

Production-oriented migration approach for a complex Oracle 19c to PostgreSQL 15 workload , covering assessment, schema and code conversion,...