0% found this document useful (0 votes)
72 views2 pages

Git Scenario-Based Questions

The document provides a series of scenario-based interview questions for QA professionals regarding Git usage. It outlines common situations such as testing features in different branches, handling merge conflicts, and managing unwanted files, along with appropriate Git commands and best practices. Additionally, it offers tips for effective Git usage in QA, emphasizing the importance of clear commit messages and frequent merges.

Uploaded by

isharav68
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views2 pages

Git Scenario-Based Questions

The document provides a series of scenario-based interview questions for QA professionals regarding Git usage. It outlines common situations such as testing features in different branches, handling merge conflicts, and managing unwanted files, along with appropriate Git commands and best practices. Additionally, it offers tips for effective Git usage in QA, emphasizing the importance of clear commit messages and frequent merges.

Uploaded by

isharav68
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Git Scenario-Based Interview Questions for QA

1. A developer told you to test a feature that is in another branch. What do you do?

I use `git fetch` to get all branches. Then I do `git checkout <branch-name>` to switch. I test the feature from that branch

and report bugs if any.

2. You wrote some test scripts and want to share them with your team. How will you do that using

Git?

I create a new branch, write and commit my scripts, push the branch, and then raise a Pull Request for team review.

3. Your automation test is failing after pulling the latest code. What steps will you take?

I check git log or git diff to see changes, identify the issue, fix my script, and retest.

4. You see a merge conflict while merging your branch. What do you do?

Use `git status` to find conflict files, resolve manually, then add, commit, and push again.

5. You pushed some unwanted files like .log or testdata.csv. How do you fix it?

Remove them using `git rm`, commit the changes, and add to `.gitignore` to prevent re-adding.

6. The developer shared only one commit that needs to be tested. How will you test that?

Use `git cherry-pick <commit-id>` on your branch, test it, and remove if needed using `git revert`.

7. You have written a new test case, but don't want to disturb the main branch. What will you do?

Create a new branch, write/test the case, push it, and raise a Pull Request for review.

8. How do you keep your branch updated with the latest changes from the main branch?

By pulling the latest main branch and merging or rebasing it with my feature branch.

9. You want to check which team member made which changes. How do you do that?

Use `git log` for commit history and `git blame <filename>` for line-by-line authorship.
Git Scenario-Based Interview Questions for QA

10. You need to test two versions of a feature. How do you manage it?

Use separate branches or tags for each version and test them individually.

11. Your automation build in Jenkins failed after a Git push. What will you do?

Check Jenkins logs, use git log/diff to review recent changes, fix the issue, or revert the commit.

12. How do you ensure only tested code goes into the main branch?

Work on feature branches, test thoroughly, and only merge to main through Pull Requests.

13. You want to contribute a small fix without cloning the full project. What can you do?

Use GitHub's web editor to edit files online and raise a Pull Request directly.

14. What naming convention do you follow for branches in QA?

Examples: test/login-feature, bugfix/issue-102, release/v1.2-tests.

15. You accidentally deleted a branch locally. How do you get it back?

If it exists remotely, fetch and checkout again. If not, use `git reflog` to recover.

Tips for QA to Use Git Effectively

- Pull latest code before starting work

- Avoid working directly on main

- Write clear commit messages

- Always raise Pull Requests

- Use `.gitignore` for logs/data

- Merge frequently to reduce conflicts

You might also like