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. Does git stash save untracked files, and how do you include them?

    By default git stash saves only tracked changes. Add -u (--include-untracked) to also stash new files, or -a to include ignored files as well.

    BeginnerQuick answer1 min read
  2. What does git clean do, and how do you use it safely?

    git clean deletes untracked files from the working directory. Because they were never committed, they cannot be recovered, so always run git clean -n first to preview what would be removed.

    IntermediateQuick answer1 min read