star iconstar iconstar iconstar iconstar icon

"Huge timesaver. Worth the money"

star iconstar iconstar iconstar iconstar icon

"It's an excellent tool"

star iconstar iconstar iconstar iconstar icon

"Fantastic catalogue of questions"

Ace your next tech interview with confidence

Explore our carefully curated catalog of interview essentials covering full-stack, data structures and algorithms, system design, data science, and machine learning interview questions

GIT

100 GIT interview questions

Only coding challenges
Topic progress: 0%

Git Fundamentals


  • 1.

    What is Git and why is it used?

    Answer:
  • 2.

    How does Git differ from other version control systems (VCS)?

    Answer:
  • 3.

    What is the difference between Git and GitHub?

    Answer:
  • 4.

    What is a repository in Git?

    Answer:
  • 5.

    Explain the concept of a commit in Git.

    Answer:
  • 6.

    What is the difference between a working directory, staging area, and repository in Git?

    Answer:
  • 7.

    Define branching in Git and its importance.

    Answer:
  • 8.

    What is a HEAD in Git?

    Answer:
  • 9.

    What does the ‘clone’ operation in Git do?

    Answer:
  • 10.

    How does Git store information?

    Answer:

Basic Git Commands


  • 11.

    How do you initialize a new Git repository?

    Answer:
  • 12.

    Explain the purpose of the git status command.

    Answer:
  • 13.

    What does the git add command do?

    Answer:
  • 14.

    How do you create a commit in Git?

    Answer:
  • 15.

    What information is contained in a commit object in Git?

    Answer:
  • 16.

    How does git push differ from git fetch?

    Lock icon indicating premium question
    Answer:
  • 17.

    Explain the purpose of the git pull command.

    Lock icon indicating premium question
    Answer:
  • 18.

    Describe the use of git branch command.

    Lock icon indicating premium question
    Answer:
  • 19.

    How do you switch branches using git checkout?

    Lock icon indicating premium question
    Answer:
  • 20.

    What is the purpose of git merge?

    Lock icon indicating premium question
    Answer:

Git Branching and Merging


  • 21.

    Explain the Git workflow you use most frequently.

    Lock icon indicating premium question
    Answer:
  • 22.

    Can you describe the process of creating a new branch and merging it back into the main branch?

    Lock icon indicating premium question
    Answer:
  • 23.

    What is a merge conflict in Git and how do you resolve it?

    Lock icon indicating premium question
    Answer:
  • 24.

    What is a fast-forward merge in Git?

    Lock icon indicating premium question
    Answer:
  • 25.

    Define a three-way merge.

    Lock icon indicating premium question
    Answer:
  • 26.

    How do you rebase a branch in Git?

    Lock icon indicating premium question
    Answer:
  • 27.

    Explain the pros and cons of rebasing vs. merging.

    Lock icon indicating premium question
    Answer:
  • 28.

    What is the purpose of git tag?

    Lock icon indicating premium question
    Answer:
  • 29.

    How do you revert a commit that has already been pushed to the remote repository?

    Lock icon indicating premium question
    Answer:
  • 30.

    What is the significance of the master branch in Git?

    Lock icon indicating premium question
    Answer:

Git Workflows and Patterns


  • 31.

    What is a distributed version control system and how does Git function as one?

    Lock icon indicating premium question
    Answer:
  • 32.

    Describe the Git feature branch workflow.

    Lock icon indicating premium question
    Answer:
  • 33.

    Explain the Gitflow workflow.

    Lock icon indicating premium question
    Answer:
  • 34.

    What is a Forking workflow in Git?

    Lock icon indicating premium question
    Answer:
  • 35.

    Discuss the Centralized workflow in Git.

    Lock icon indicating premium question
    Answer:

Git Repository Management


  • 36.

    Explain what a remote repository is in Git.

    Lock icon indicating premium question
    Answer:
  • 37.

    Describe how you would change a Git remote URL.

    Lock icon indicating premium question
    Answer:
  • 38.

    How do you synchronize your local repository with a remote repository?

    Lock icon indicating premium question
    Answer:
  • 39.

    How do you clean up unused branches in your local and remote repository?

    Lock icon indicating premium question
    Answer:
  • 40.

    Describe the steps to resolve a merge conflict in Git.

    Lock icon indicating premium question
    Answer:

Git Stashing and Cleaning


  • 41.

    What is git stash used for?

    Lock icon indicating premium question
    Answer:
  • 42.

    How do you view stashed changes in Git?

    Lock icon indicating premium question
    Answer:
  • 43.

    Can you apply a stash without removing it from the stash list?

    Lock icon indicating premium question
    Answer:
  • 44.

    What does the git clean command do?

    Lock icon indicating premium question
    Answer:
  • 45.

    How do you remove a file from the working directory without deleting it from the repository?

    Lock icon indicating premium question
    Answer:

Git Logging and History


  • 46.

    How do you view the commit history in Git?

    Lock icon indicating premium question
    Answer:
  • 47.

    Explain how to find a commit by a specific author in Git.

    Lock icon indicating premium question
    Answer:
  • 48.

    How do you view the changes introduced in a commit?

    Lock icon indicating premium question
    Answer:
  • 49.

    Can you list the files changed in a specific commit?

    Lock icon indicating premium question
    Answer:
  • 50.

    What does the git blame command do?

    Lock icon indicating premium question
    Answer:

Git Tagging and Releases


  • 51.

    What are Git tags and how are they different from branches?

    Lock icon indicating premium question
    Answer:
  • 52.

    How do you create, delete, and push tags?

    Lock icon indicating premium question
    Answer:
  • 53.

    What is semantic versioning in the context of Git tagging?

    Lock icon indicating premium question
    Answer:
  • 54.

    How would you checkout to a specific tag?

    Lock icon indicating premium question
    Answer:
  • 55.

    Describe how to create a release from a tag.

    Lock icon indicating premium question
    Answer:

Advanced Git Operations


  • 56.

    What is a git submodule and when would you use one?

    Lock icon indicating premium question
    Answer:
  • 57.

    Explain the purpose of a git hook.

    Lock icon indicating premium question
    Answer:
  • 58.

    How do you perform a squash commit in Git?

    Lock icon indicating premium question
    Answer:
  • 59.

    What is a git bisect and how do you use it?

    Lock icon indicating premium question
    Answer:
  • 60.

    How do you manually resolve a conflict during a git merge?

    Lock icon indicating premium question
    Answer:

Git Configuration and Customization


  • 61.

    How do you set your username and email in Git?

    Lock icon indicating premium question
    Answer:
  • 62.

    What is the scope of Git configuration files?

    Lock icon indicating premium question
    Answer:
  • 63.

    How can you create aliases for Git commands?

    Lock icon indicating premium question
    Answer:
  • 64.

    What is the purpose of a .gitignore file?

    Lock icon indicating premium question
    Answer:
  • 65.

    How would you ignore files globally?

    Lock icon indicating premium question
    Answer:

Git Security


  • 66.

    How do you ensure your commits are signed with your GPG key?

    Lock icon indicating premium question
    Answer:
  • 67.

    What are some common security practices for Git repositories?

    Lock icon indicating premium question
    Answer:
  • 68.

    How do you encrypt sensitive data in a Git repository?

    Lock icon indicating premium question
    Answer:
  • 69.

    What are some strategies for credential storage in Git?

    Lock icon indicating premium question
    Answer:
  • 70.

    How would you revoke access to a Git repository?

    Lock icon indicating premium question
    Answer:

Troubleshooting and Recovery


  • 71.

    How do you find and restore a deleted file in a Git repository?

    Lock icon indicating premium question
    Answer:
  • 72.

    What steps would you take if you accidentally committed sensitive data?

    Lock icon indicating premium question
    Answer:
  • 73.

    How do you handle detached HEAD state in Git?

    Lock icon indicating premium question
    Answer:
  • 74.

    Explain how to recover a dropped stash in Git.

    Lock icon indicating premium question
    Answer:
  • 75.

    How do you amend the message of the last commit?

    Lock icon indicating premium question
    Answer:

Git Collaboration


  • 76.

    What is a pull request and how does it work?

    Lock icon indicating premium question
    Answer:
  • 77.

    How do you update a pull request?

    Lock icon indicating premium question
    Answer:
  • 78.

    What is a code review process in Git?

    Lock icon indicating premium question
    Answer:
  • 79.

    How do you handle a pull request conflict?

    Lock icon indicating premium question
    Answer:
  • 80.

    What is the difference between git pull and git fetch followed by git merge?

    Lock icon indicating premium question
    Answer:

Git Performance and Scalability


  • 81.

    How do you handle large files in Git?

    Lock icon indicating premium question
    Answer:
  • 82.

    What are some ways to improve the performance of a large Git repository?

    Lock icon indicating premium question
    Answer:
  • 83.

    What is a shallow clone in Git and when would you use it?

    Lock icon indicating premium question
    Answer:
  • 84.

    How do you reduce the repository size in Git?

    Lock icon indicating premium question
    Answer:
  • 85.

    Explain how Git LFS (Large File Storage) is used.

    Lock icon indicating premium question
    Answer:

Git in Continuous Integration/Continuous Deployment (CI/CD)


  • 86.

    How does Git integrate with CI/CD pipelines?

    Lock icon indicating premium question
    Answer:
  • 87.

    Describe the process of automating deployments using Git.

    Lock icon indicating premium question
    Answer:
  • 88.

    How would you configure branch protection rules for a repository in the context of CI/CD?

    Lock icon indicating premium question
    Answer:
  • 89.

    What role do Git hooks play in automation?

    Lock icon indicating premium question
    Answer:
  • 90.

    How can Git help in the rollback process of a failed deployment?

    Lock icon indicating premium question
    Answer:

Git with IDEs and Tools


  • 91.

    How do you integrate Git with your preferred IDE?

    Lock icon indicating premium question
    Answer:
  • 92.

    Discuss the pros and cons of using a GUI tool for Git versus the command line.

    Lock icon indicating premium question
    Answer:
  • 93.

    What plugins are commonly used with Git in development environments?

    Lock icon indicating premium question
    Answer:
  • 94.

    How do you resolve merge conflicts using a visual tool?

    Lock icon indicating premium question
    Answer:
  • 95.

    What is the purpose of a Git bridge for version control systems?

    Lock icon indicating premium question
    Answer:

Advanced Git Topics


  • 96.

    How do you handle large binary files in Git without using Git LFS?

    Lock icon indicating premium question
    Answer:
  • 97.

    What is the purpose of the git rebase -i command?

    Lock icon indicating premium question
    Answer:
  • 98.

    How would you set up a continuous backup process for Git repositories?

    Lock icon indicating premium question
    Answer:
  • 99.

    Explain the impact of case sensitivity in Git and how to manage it across different operating systems.

    Lock icon indicating premium question
    Answer:
  • 100.

    How do you maintain multiple versions of a product using Git branches for each version?

    Lock icon indicating premium question
    Answer:
folder icon

Unlock interview insights

Get the inside track on what to expect in your next interview. Access a collection of high quality technical interview questions with detailed answers to help you prepare for your next coding interview.

graph icon

Track progress

Simple interface helps to track your learning progress. Easily navigate through the wide range of questions and focus on key topics you need for your interview success.

clock icon

Save time

Save countless hours searching for information on hundreds of low-quality sites designed to drive traffic and make money from advertising.

Land a six-figure job at one of the top tech companies

amazon logometa logogoogle logomicrosoft logoopenai logo
Ready to nail your next interview?

Stand out and get your dream job

scroll up button

Go up