Git Interview Questions

Practice for Git interviews by solving TestDome questions. Our interview questions are used by more than 7,000 companies and 450,000 individual test takers.

Jobseekers: Certify Your Knowledge

Take a Certification Test

Companies: Use Our Tests for Screening

Buy a Pack Of Candidates

These Git interview questions are examples of real tasks used by employers to screen job candidates such as web developers, front-end developers, back-end developers, and others that require knowledge of source control and collaborative development.

1. Force Checkout

Git Command Line Arguments Public

A developer is experimenting with code on a local copy of a branch. After a while, it is decided that this experiment does not work. So the developer decides to switch back to the master branch. However, the developer's local working copy is different from the HEAD.

Which of these options would allow the developer to successfully check out the master branch?

(Select all acceptable answers.)

Solve Question

2. Saving a Bugfix

Git Command Line Arguments Public

Write down a sequence of GIT commands (with no additional arguments) to download a repository, update a file, and save the changes back to the original repository. Assume that other developers didn't modify the file.

  1. Download the master repository to a local directory or repository:
    git _____
  2. Fix a bug in file test.cpp
  3. Mark that file test.cpp has been changed:
    git _____ test.cpp
  4. Save the changes to the local repository:
    git _____ -m 'Bug with testing is fixed'
  5. Send the changes to the original repository:
    git _____ origin master
Solve Question

If you feel ready, take one of our timed public Git Interview Questions tests:
DevOps Practices

DevOps Test (Easy)


Git Test (Easy)

Not exactly what you are looking for? Go to our For Jobseekers section.
Dashboard Start Trial Sign In Home Tour Tests Questions Pricing For Jobseekers