Git 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”).

Recent Articles

Where Do I Get Git?

Where do you get git? We have the answer to that for Linux (Ubuntu, Debian, and Red Hat), Windows, and Apple OS as well as over 30 free git tutorials.

What is the deal with the Git Index? What is the Git Index?

The git "index" is where you place files you want committed to the git repository. Learn more about the git index and git commit by selecting this link.

What Every VCS Must do

Version Control System ("VCS") need to be able to provide to its users? GitGuys explains exactly what it needs to include and provides tutorials on Git.

Visualising Branches And Their Commits

We explain and discuss the use of the git show-branch, gitg, gitk and qgit in this Tutorial. Complete with examples.

“Tracking Branches” And “Remote-Tracking Branches”

Both Tracking Branches and Remote Tracking Branches are created on the git client when a git clone command is used.

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox