Video in progress
People call Git a "distributed" version control system. What does that mean in practice?
Every developer has a full copy of the repository: the whole history, branches and commits. Committing, log, diff and creating branches all work locally with no server; the server is only needed for exchanging changes.
📖 Answer
In a centralized system such as SVN, the history lives only on the server. If the server is down, you cannot commit, and you cannot even look at the log.
In Git, when you git clone, the whole history lands in the .git folder. That means:
- you can commit and create branches even on a plane;
git log,git diffandgit blameare fast, because they do not go over the network;- even if the server (GitHub, GitLab) disappears, you can restore it from any developer's copy.
GitHub is not Git. Git is the program, and GitHub/GitLab/Bitbucket are services that host the repository and add PRs, CI and issues on top. Interviewers like to see whether you mix these two up.
Sign up to mark studied questions and save your progress.