Git & GitHub Q&A
Covers Git basics, branching, merging, pull requests, Git workflow, common commands, merge conflicts, git fetch vs pull, and real-world scenarios.
Source: GOLDEN_QUESTIONNAIRE_JULY_2026.pdf • Answers are hidden — click a question to reveal its full interview answer. Use bookmarks + Mark as Complete to track prep.
How did you use Git in your project?
click to reveal answerInterview Answer: In my project, we used Git for version control. Every developer worked on a separate branch, committed their changes locally, and pushed them to GitHub. After code review through a Pull Request, the changes were merged into the main branch. This helped us collaborate without affecting the production code.
What is the Git workflow followed in your project?
click to reveal answerInterview Answer: Our workflow was: Clone the repository → Create a feature branch → Make code changes → Commit the changes → Push to GitHub → Create a Pull Request → Code Review → Merge into the main branch → Deploy the application.
Clone
Copy the repository
locally
Feature Branch
Create a branch for
work
Code & Commit
Make changes and
commit
Push & PR
Push, open pull
request
What happens when you run git push?
click to reveal answerInterview Answer: git push uploads all committed changes from the local repository to the remote GitHub repository. It allows other team members to access the latest code. Usually, after pushing the code, we create a Pull Request for review before merging.
Why do we create branches in Git?
click to reveal answerInterview Answer: We create branches to develop new features or fix bugs without affecting the main code. Every developer works on their own branch. Once the work is completed and reviewed, it is merged into the main branch.
What is a Pull Request (PR)?
click to reveal answerInterview Answer: A Pull Request is a request to merge code from one branch into another. It allows team members to review the code, suggest changes, and approve it before merging. This helps maintain code quality and avoid production issues.
What is a Merge Conflict? How did you resolve it?
click to reveal answerInterview Answer: A merge conflict occurs when two developers modify the same part of the same file. Git cannot decide which change to keep automatically. I resolved it by reviewing both changes, keeping the correct code, testing it, and then committing the resolved version.
Commit
ResolvedTest Code
Keep
Correct
Code
Review
Changes
What Git commands do you use most often?
click to reveal answerInterview Answer: In my daily work, I mostly use git clone, git status, git add, git commit, git pull, git push, git branch, git checkout, and git merge. These commands are enough for most day-to-day development tasks.
git clone git status git add
git commit git pull git push
git branch git checkout git merge
What will you do if your local branch is behind the remote branch?
click to reveal answerInterview Answer: First, I would run git pull to fetch the latest changes from the remote repository. If there are any conflicts, I would resolve them, test the code, and then push my updated changes back to GitHub.
How do you check which files have changed before committing?
click to reveal answerInterview Answer: I use the git status command to check modified, staged, and untracked files. If I want to see the exact code changes, I use git diff before committing.
git status
Check modified, staged, and untracked files
git diff
See the exact code changes before committing
What production issue did you face while using Git?
click to reveal answerInterview Answer: One issue I faced was a merge conflict when two developers modified the same file. We resolved the conflict by reviewing both changes, testing the final code, and then merging it. After that, we informed the team to pull the latest code before making further changes.
What is the difference between git fetch and git pull?
click to reveal answerInterview Answer: git fetch only downloads the latest changes from the remote repository but does not merge them. git pull downloads the changes and automatically merges them into the current branch. I usually use git pull to keep my branch updated.
git fetch
Downloads the latest changes from the remote repository but
does not merge them
git pull
Downloads the changes and automatically merges them into
the current branch
Suppose you accidentally committed a wrong file. What will you do?
click to reveal answerInterview Answer: If the commit is only in my local repository, I can undo it and recommit the correct files. If it has already been pushed, I would use Git commands like git revert or create a new commit to fix the mistake, depending on the team's process.
These questions closely match the Git topics covered in your PDF (workflow, commands, branching, merging, tracking, and merge conflicts) and are well suited for Data Engineer interviews.