“We Train, You Succeed: Trusted by Thousands for Training & Placement”. Know more!

Call us @ 9666019191

HomeInterview QuestionsGit interview questions

Git interview questions

Basic Git Questions:

  1. What is Git?
    • Explain the purpose of version control and Git’s role in it.
  2. What is the difference between Git and GitHub?
    • How is Git different from GitHub or other hosting platforms like GitLab, Bitbucket, etc.?
  3. What are the main features of Git?
    • Mention features like branching, version control, distributed nature, and more.
  4. Explain the Git workflow.
    • Working directory, staging area, and local repository.
  5. What are the basic Git commands?
    • Commands like git init, git add, git commit, git push, and git pull.
  6. What is a Git repository?
    • Differentiate between local and remote repositories.
  7. What is the staging area in Git?
    • Describe how git add works and its role in version control.
  8. What is the difference between git clone and git fork?
    • Explain how cloning duplicates the repository while forking copies it into your own GitHub account.
  9. How do you create a new branch in Git?
    • Explain git branch <branch_name> and git checkout -b <branch_name>.
  10. What is git merge?
    • How does it merge branches, and what is a “fast-forward” merge?

Advanced Git Questions:

  1. What is git rebase, and how does it differ from git merge?
    • Explain both, and discuss scenarios where rebasing is better suited.
  2. What is a git stash?
    • How can you use git stash to temporarily save changes without committing?
  3. What is the difference between git fetch and git pull?
    • Describe how git fetch only updates local metadata while git pull also integrates the changes.
  4. What are git cherry-pick and git revert?
    • How do you selectively apply or undo commits?
  5. What is a “detached HEAD” state in Git?
    • Discuss how this happens and how to resolve it.
  6. How can you undo the last commit?
    • Explain git reset –soft HEAD~1 and git revert.
  7. What is the purpose of .gitignore?
    • Explain how to use this file to prevent unwanted files from being committed.
  8. How do you resolve merge conflicts in Git?
    • Describe the process of conflict resolution and tools that can help (e.g., git mergetool).
  9. What is Git submodule?
    • Describe how you can include another repository inside your project and manage dependencies.
  10. What is git bisect, and how does it help in debugging?
    • Explain how git bisect is used to perform a binary search to identify the commit that introduced a bug.

GitHub-Specific Questions:

  1. How does GitHub handle collaboration?
    • Discuss pull requests, issues, and code reviews.
  2. What are GitHub Actions?
    • Explain CI/CD workflows within GitHub.
  3. What is a GitHub Fork, and when would you use it?
    • How does forking help when contributing to open-source projects?
  4. What is a Pull Request, and how is it different from pushing code?
    • Discuss how pull requests facilitate code reviews and collaboration in GitHub.
  5. What are tags in Git and GitHub?
    • Explain how tags are used for marking releases and important versions.
  6. What are GitHub repositories’ permissions?
    • Explain the difference between owner, collaborator, and other roles.
  7. How can you secure a GitHub repository?
    • Mention strategies like two-factor authentication, branch protection rules, and limiting write access.
  8. How do you squash commits in Git/GitHub?
    • Explain squashing commits into one using git rebase -i and why this might be useful.
  9. How do you link a local Git repository with a remote repository on GitHub?
    • Describe git remote add origin <repository_URL> and git push.
  10. What is the difference between public and private repositories in GitHub?
    • Discuss visibility and accessibility between the two.

These questions span across basic and advanced concepts, providing a solid foundation for Git and GitHub knowledge in an interview.

For Cloud and Devops placement call 9666019191

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Amazon Web Services and Azure Amazon Web Services (AWS) is a secure cloud services platform, offering compute power, database storage, content delivery...
About Cloudsoft: Cloud Soft Solutions is leading training provider offers a comprehensive portfolio of technical training and education services designed...
Cloudsoft – Empowering Careers in Software Industry Cloudsoft has proudly placed 5000+ trainees in Top MNCs across the globe, reaffirming...
×

Hello!

Click one of our contacts below to chat on WhatsApp

×