Glossary

Common Ancestor

When merging a file with conflicts: The version of the file that current and other branches originated from.

Dirty working directory

If files have been updated in the working directory after they were updated in the index then the working directory is considered “dirty”. The working directory is clean if all modified files in the working directory have been added to the index.

Hash

Git computes the SHA-1 hash of a file with a hash value of 160 bits (which is 20 8-bit bytes or 40 4-bit hex digits) that uniquely identifies the contents of the file. Two files with identical contents will have the same hash value. Two files with different contents will have different hash values.

HEAD

The HEAD is a pointer to the most recent commit on the current branch. It is a hash value of the commit.

Index

The staging area where files are added (e.g. “git add”) and removed (e.g. “git rm”) before they are committed to a repository. Files start in the user’s working directory before moving to the index.
Other names for the index:

  • Cache
  • Directory cache
  • Current directory cache
  • Staging area
  • Staged files

Refspec

When using commands that work with remote repositories such as git pull/fetch/push, the refspec is used to configure which remote branch(es) should be used and what the local branch(es) should be named. The format of a refspec is [+]source-branch:destination-branch.

Tracked files

Once a file is added to the index , the file path is then known to git and is considered tracked.

Tracking Branch

When remote repositories are used, the local git user uses commands that set up branches that track the progress/commits of remote repositories. When the user types git fetch or git pull, a tracking branch is updated with the latest from the remote repository. A user does their development in a local branch, pulls/fetches commits from remote repositories into their tracking branches, then merges changes from their tracking branches into their local branches.

Working directory

The directory where the checked out files reside. Files in the working directory can be added to the git (e.g. “git add”).

Translation