Why is this called git checkout?

From what I understand, git checkout changes the state of the files in the current directory to what was at a specific point in the tree. Therefore, it can be used to switch branches or to visit a previous commit.

Why is the name checkout chosen for this operation?

Is the analogy "I'm going to test this"?
Is it checking books from the library?

I do not ask whether this is a good idea or not, or trying to judge it myself - I just wonder what the historical origin of the name is.

+7
git
source share
3 answers

Most of this is historical. Pregit version control systems (VCSes) used verb verification and verification.

Excerpt from the book I'm working on:

Used as a verb, prior to version means putting VCS under control. Used as a noun, version means a specific version taken from VCS (single file or group of files). Usually the noun form appears with additional modifiers, as in the phrase the old version of kanga.c or version 2.1 of roo.c If there are no specific files in the list, we usually mean everything, or at least everything that was recently discussed: version 2.1 (all in the repository, or about the specific files and / or directories that we talked about). Revision of a word is always a noun, but otherwise it means the same as version.

Another verb to check means store in VCS. As expected, if we can register, we can also check the meaning of excerpts from VCS. Some VCS add an update verb, which they can use to extract the old version (which you are checking) and moving on to the latter and (hopefully) more (to which you are updating). Mercurial uses the update as a pure synonym for validation.

+5
source share

This is part of the usual vocals of version control systems, and although its behavior is different from the first, based on blocking, version control systems seem like a natural evolution.

2005

  man git checkout 

NAME git -checkout - checking a branch or paths to a working tree [...]

DESCRIPTION Updates the files in the working tree according to the version in the index or the specified tree. If no paths are specified, git checkout will also update HEAD to set the specified branch as the current branch.


2000

  svn help checkout 
 checkout (co): Check out a working copy from a repository. 

1986

  man cvs 
 checkout Check out sources for editing [...] Create or update a working directory containing copies of the source files specified by modules. You must execute checkout before using most of the other cvs commands, since most of them operate on your working directory. The modules are either symbolic names for some collection of source directories and files, or paths to directories or files in the repos‐ itory. The symbolic names are defined in the modules file. See node 'modules' in the CVS manual. Depending on the modules you specify, checkout may recursively create directories and populate them with the appropriate source files. You can then edit these source files at any time (regardless of whether other software developers are editing their own copies of the sources); update them to include new changes applied by others to the source repository; or commit your work as a permanent change to the source repository. 

1982 RCS

 man co 

co extracts the revision from each RCS file and saves it to the corresponding working file.

Path names corresponding to the RCS suffix indicate RCS files; all the rest are working files. Names are paired as described in ci (1).

RCS file corrections can be checked locked or unlocked. Revision lock prevents duplication of updates. Revised validation for reading or processing (e.g. compilation) need not be blocked. The revised revision for editing and subsequent registration should usually be blocked. The check with blocking fails if the checked revision is currently blocked by another user. (The lock can be broken into rcs (1).) Checkout with locking also requires the caller to be in the access list of the RCS file, unless he is the owner of the file or superuser, or the access list is empty. Placement of an order without blocking does not fall under access restrictions and does not depend on the presence of locks.


nineteen seventy two

SCCS did not have a check; he had a check. Maybe someone can confirm that this cvs took the idea from there.

 man SCCS 

check Similar to information, except that nothing is printed if nothing is edited, and a nonzero exit status is returned if something is edited. The goal is to include this in the `` install '' entry in the makefile to ensure that everything is included in the SCCS file before the version is installed.

+4
source share

I guess someone can tell you where the name Is Linus Torvalds came from, which git developed.

Based on the action that the check performs - switching the contents of the working directory, I can only assume that the origin of this word is similar to what you described

Checking out book from the library

From the documentation:
https://www.kernel.org/pub/software/scm/git/docs/git-checkout.html

git-checkout - Checkout a branch or path to the working tree


Links:

+2
source share

All Articles