Skip to content

40 facts

40 Fun Facts About Git

Learn something new, then test yourself with the quiz.

Know these facts? Prove it.

Take the 40-question quiz
1

The name Git, chosen by its creator as a joke at his own expense, is British slang for what?

An unpleasant person is the slang sense. The project's read-me adds that the name was a pronounceable three-letter combination that no common Unix command was already using.

2

Which technology giant paid $7.5 billion in 2018 for GitHub, the code-hosting site built around Git?

Microsoft was already a heavy user of the site, hosting open-source projects such as Visual Studio Code and PowerShell there, before it decided to buy the whole company.

3

Which programmer wrote Git in 2005 and joked that he names all his projects after himself?

Linus Torvalds announced Git within days of starting work on it, and by the following day it was being used to store its own source code.

4

Which Git command sends local commits to a remote, and is refused if that remote holds newer work?

git push can be forced through with the --force option, but that can make the remote repository lose commits, so the manual says to use it with care.

5

Which Git command copies an existing repository, full history included, into a new directory?

git clone brings down every version of every file by default, which is why almost any copy can be used to rebuild a server whose disk has been corrupted.

6

Git's strategy for merging more than two branches at once is named after which sea creature?

Octopus is the strategy Git uses by default when more than two branches are merged, though it refuses any merge complex enough to need resolving by hand.

7

Which Git command labels every line of a file with the revision and author that last modified it?

git blame follows lines through file renames automatically, and extra options let it trace lines that were moved or copied in from another file.

8

Git was written because developers of which open-source project lost free use of a proprietary tool?

The Linux kernel moved quickly: work on Git began in early April 2005, and by mid-June the new tool was managing an official release of the project.

9

When two Git branches change the same lines of a file differently, a merge reports which problem?

A conflict pauses the merge and leaves both versions in the file, fenced off by rows of marker characters, until someone edits it by hand.

10

Which Git command sets aside uncommitted changes so the working directory matches the last commit?

git stash saves the work on a stack of unfinished changes, which can be reapplied at any time, even on a different branch.

11

Which Git command makes a hidden .git directory in a folder, turning it into an empty repository?

git init is safe to run a second time in an existing repository, because it will not overwrite anything that is already there.

12

Which Git command puts new or changed file contents in the staging area, ready for the next commit?

git add captures a file's contents only as they are at that moment, so any later edits to the same file must be added again before they are committed.

13

Which Git command lists which files are staged, modified or untracked, and changes nothing itself?

git status prints a hint beside each group of files, naming the command that would stage those changes or throw them away.

14

Which Git command lists a branch's commits, newest first, with each one's author, date and message?

git log accepts filters such as --since and --author, so the list can be narrowed to one developer's commits from the last two weeks.

15

Which Git command shows line by line what has changed in the working tree but is not yet staged?

git diff with the --staged option looks one step further on, comparing what has been staged with the last commit to show what is about to be recorded.

16

Which Git command downloads new commits from a remote and integrates them into the current branch?

git pull, run with no arguments, takes its commits from the upstream branch that the current branch has been set up to follow.

17

Which plain-text file tells Git which files, such as build output or passwords, to leave untracked?

.gitignore has no effect on files that Git is already tracking, a common surprise for anyone who adds a pattern after the file has been committed.

18

Which proprietary version-control tool did Git replace after its owner withdrew the free licence?

BitKeeper's owner withdrew the licence after claiming a developer had reverse-engineered its protocols. Eleven years later the tool itself was released as open-source software.

19

Which default name does Git give the remote repository that a local copy was first downloaded from?

origin is only a convention: the remote can be renamed at any time, and a different name can be chosen when the copy is first made.

20

Which Git reference to the checked-out commit is called detached when it points at no branch?

HEAD normally stores the name of a branch. While it is detached, new commits still work, but they move only this reference and leave every branch untouched.

21

Which Git command downloads new commits from a remote but leaves your files and branches untouched?

git fetch only brings the data into your local repository, so the new work can be inspected first and combined with your own when you are ready.

22

Which Git command, added in version 2.23, handles the branch-changing half of git checkout's job?

git switch arrived alongside a sister command for putting files back, because checkout had been doing two unrelated jobs under a single name.

23

Which option of git commit rewrites the most recent commit instead of adding a new one on top?

--amend builds a brand-new commit to take the old one's place, so the manual warns anyone using it on work that has already been published.

24

Which short option gives git commit its message on the command line instead of opening an editor?

-m can be given more than once, in which case each value becomes a separate paragraph of the finished commit message.

25

Which Git command undoes an earlier commit by adding a new commit that cancels out its changes?

git revert leaves the faulty commit in the history, which makes it the safe way to back out work that other people have already built upon.

26

Which Git command transplants a run of commits onto a new starting point, giving a linear history?

git rebase makes new copies of the commits it moves, hence the Pro Git book's one-line warning never to use it on commits that exist outside your own repository.

27

Which Git command gives a commit a fixed name such as v1.0, typically to mark a release?

git tag makes two kinds of marker: a lightweight one is just a pointer to a commit, while an annotated one also stores its author's name, a date and a message.

28

Which Git command sets values such as user.name and user.email, which are stamped on every commit?

git config writes to one of three levels, and a value in a repository's own settings file overrides the same value set for the whole computer.

29

Git was built as a set of programs in which language, with shell scripts wrapped around them?

C went on to replace most of those wrappers as well: the shell scripts around the core programs were later rewritten in it for speed and portability.

30

Git belongs to which family of version-control systems, unlike CVS, Subversion and Perforce?

Distributed systems give every developer a complete mirror of the repository, which is why most Git operations need no network connection at all.

31

Which Git command removes untracked files, and by default refuses to delete anything unless given -f?

git clean has a dry-run option, -n, that only lists what would go, a wise first step because the files it deletes were never recorded and often cannot be retrieved.

32

Which name does Git give to scripts, such as pre-commit, that it runs when certain actions occur?

Hooks are kept in a folder inside the .git directory, where Git supplies example scripts that stay switched off until their .sample ending is removed.

33

Which kind of Git merge needs no merge commit because the current branch has no new work of its own?

Fast-forward merges simply move the branch pointer to the newer commit, because there is no divergent work to combine.

34

Which hash function, giving 40 hexadecimal characters, was Git first built to name its objects with?

SHA-1 names are calculated from each object's contents, so Git cannot lose information in transit or suffer file corruption without being able to detect it.

35

Which Git command applies the change from one existing commit to the current branch as a new commit?

git cherry-pick is useful when a topic branch holds a number of commits and only one of them is wanted on another branch.

36

Which mode of git reset discards changes in the working tree as well as moving the branch back?

--hard is the only form of the command that the Pro Git book calls dangerous, because it forcibly overwrites files in the working directory.

37

Which Git command finds the commit that introduced a bug by having you mark versions good or bad?

git bisect uses a binary search, halving the range of suspect commits each time, and it can run a test script to do the marking for you.

38

Which Git command shows where branch tips used to point, helping recover commits that seem lost?

git reflog draws on a record that is strictly local: it covers only what has been done in your own repository, and a fresh copy of a project starts with none.

39

Which developer became Git's maintainer in July 2005 and oversaw its 1.0 release that December?

Junio Hamano had been a major contributor in Git's first months, and the project's creator handed it over to him less than four months after starting it.

40

Git calls its low-level commands plumbing; which matching name does it give the user-friendly ones?

Porcelain commands such as checkout and branch are the ones most users meet; the layer beneath was designed to be chained together or called from scripts.

Think you know Git?

Put these facts to the test with the interactive quiz.

Take the 40-question quiz

Teaching Git?

Make a custom quiz — handy for classrooms and study groups.

Make a quiz on anything

Related quizzes