Interview Q&A / Git & GitHub
Git & GitHub interview questions
Branching, merge vs rebase, resolving conflicts and pull requests, the way teams actually work.
Prefer rapid revision? Practise Git & GitHub short interview answers →
- What is an upstream branch in Git?
An upstream branch is the remote branch that your local branch is linked to. With it set, plain git pull, git push and git status know where to send and compare changes without extra arguments.
BeginnerQuick answer1 min read - How do you keep a forked repository up to date with the original project?
Add the original repo as a second remote called upstream, fetch it, merge or rebase upstream/main into your main, and push to your fork. GitHub also has a Sync fork button for the same job.
IntermediateQuick answer1 min read