skip to content

Version Control & Hosting

Git itself plus the platforms built around it — GitHub, GitLab, Bitbucket — where repositories, code review, CI, packages and cloud dev environments live. Interviewers use this area constantly because every job involves a branching model, a review process, and a pipeline attached to a push.

on this pageshow

explore

→ has its own guide

questions

322 · 2 sections

In Git, what does creating a branch with git branch feature actually do?

level: juniorimportance: must knowfreq 82%
basics
~20 s

It writes one new ref holding the hash of the commit you branched from. No files are copied and no history is duplicated, which is why branching is instant in a repository of any size.

open as a page

In Git, what do the <<<<<<<, =======, and >>>>>>> markers in a conflicted file mean?

level: juniorimportance: must knowfreq 85%
basics
~20 s

Git writes both versions of a region it could not merge into the file. Text between <<<<<<< and ======= is the side you are on; text between ======= and >>>>>>> is the incoming side. You edit the file to the final content, delete the markers, and stage it.

open as a page

In Git, what is a fast-forward merge and when can Git perform one?

level: juniorimportance: must knowfreq 80%
basics
~20 s

A fast-forward merge happens when the current branch's commit is already an ancestor of the commit being merged. Git records no merge commit; it simply moves the branch pointer forward and updates the index and working tree.

open as a page

In Git, what is a three-way merge and which three commits does it use?

level: juniorimportance: must knowfreq 68%
basics
~20 s

A three-way merge combines two branch tips using their best common ancestor, the merge base, as a reference point. Comparing each tip against that base tells Git which side changed what, so it can combine changes instead of guessing.

open as a page

In Git, how do the --system, --global and --local config scopes differ, and which one wins?

level: juniorimportance: must knowfreq 70%
basics
~10 s

They name three config files: machine-wide, per-user, and per-repository. Git reads them in that order and the narrower scope wins, so a repository's .git/config overrides your home-directory settings, which override the system file.

open as a page

What is GitHub Actions, and where in a repository must a workflow file live to be run?

level: juniorimportance: must knowfreq 72%
basics
~10 s

GitHub Actions is GitHub's built-in automation and CI/CD system. A workflow is a YAML file in the repository's .github/workflows directory that declares the events triggering it and the jobs to run when one occurs.

open as a page

In GitHub, what happens when you push straight to main if a rule requires a pull request?

level: juniorimportance: must knowfreq 68%
basics
~20 s

GitHub's server refuses the push. The remote rejects the ref update with a protected-branch error, nothing lands on main, and your local commits are untouched — you push a topic branch and open a pull request instead.

open as a page

On a GitHub pull request, what is the difference between Approve, Request changes, and Comment?

level: juniorimportance: must knowfreq 75%
basics
~20 s

Approve endorses the pull request and counts toward any required approvals. Request changes records a blocking objection that stays until the reviewer approves or the review is dismissed. Comment leaves feedback with no verdict either way.

open as a page

In GitHub, what is a Dependabot alert and where does its data come from?

level: juniorimportance: must knowfreq 60%
basics
~20 s

A Dependabot alert is GitHub telling you that a package your repository depends on has a known vulnerability. It comes from matching the repository's dependency graph, built from committed manifests and lockfiles, against the GitHub Advisory Database.

open as a page

In GitHub, how do you make a merged pull request close an issue automatically?

level: juniorimportance: must knowfreq 72%
basics
~20 s

Put a closing keyword and the issue number, such as "Fixes #123", in the pull request description or in a commit message. When that pull request merges into the repository's default branch, GitHub closes the linked issue.

open as a page