Interview Q&A / Git & GitHub

INTERVIEW Q&A · 97 QUESTIONS

Git & GitHub interview questions

Branching, merge vs rebase, resolving conflicts and pull requests, the way teams actually work.

  1. What is a pull request, and how does the code review workflow work?

    A pull request (PR) is a request to merge your branch into another branch, usually main. You push a branch, open a PR with a clear description, automated checks run, teammates review and comment, you push fixes, and once approved the PR is merged and the branch deleted.

    BeginnerIn-depth3 min read
  2. What is the difference between Git and GitHub?

    Git is a version control tool that runs on your own computer and records the history of your code. GitHub is a website that hosts Git repositories online and adds collaboration features like pull requests, code review, issues and CI. You can use Git without GitHub, but GitHub is built on top of Git.

    BeginnerIn-depth3 min read
  3. Can you resolve a merge conflict on GitHub without using the command line?

    Yes for simple text conflicts. The pull request page has a Resolve conflicts button that opens an editor with markers; fix them, mark resolved and commit. Complex cases like deleted or binary files need a local merge.

    BeginnerQuick answer1 min read
  4. How do you link a pull request to an issue so that it closes automatically?

    Write a closing keyword such as Closes

    BeginnerQuick answer1 min read
  5. What are the three ways to merge a pull request on GitHub?

    Create a merge commit keeps all commits plus a merge commit. Squash and merge combines them into one commit. Rebase and merge replays the commits onto main without a merge commit, giving linear history.

    BeginnerQuick answer1 min read
  6. What is a draft pull request, and when would you use one?

    A draft PR signals that work is in progress and cannot be merged yet. It lets you share code early, run CI, and get feedback, then you click Ready for review when it is done.

    BeginnerQuick answer1 min read
  7. What is branch protection on GitHub, and what rules can you set?

    Branch protection rules guard important branches like main. You can require pull requests, a number of approvals, passing status checks, up-to-date branches, and block force pushes and deletion.

    BeginnerQuick answer1 min read
  8. What is GitHub Actions?

    GitHub Actions is GitHub's built-in automation. A workflow, written in a YAML file under .github/workflows, runs jobs on GitHub-hosted machines when events like a push or pull request occur, commonly for tests, builds and deployment.

    BeginnerQuick answer1 min read
  9. What is the difference between a fork, a clone and a branch?

    A fork is your own server-side copy of someone else's GitHub repository. A clone is a local copy on your computer. A branch is a separate line of work inside one repository.

    BeginnerQuick answer1 min read
  10. What makes a good GitHub issue?

    A clear title, the steps to reproduce, expected versus actual behaviour, environment details, and screenshots or logs. For features, state the problem and the outcome wanted, not only a solution.

    BeginnerQuick answer1 min read