main (an the deprecated older name master) refer to the default development branch, created along with a new repository.
Four types of branches
There are four types of branches
local branches,
local tracking branches,
remote branches and
remote tracking branches.
git branch -r shows remote branches, git branch -a shows all branches.
Mark Longair on the other hand argues that there are only two types branches:
local branches (which are displayed with git branch) and
remote tracking branches (which are displayed with git branch -r)
Fetching a branch
Fetching a branch means to get the branch's head ref from a remote repository to find out which objects are missing from the local object database, and to get them, too.
man git-fetch.
Tip of the branch
The most recent commit on a branch is referred to as the tip of that branch.
The tip of the branch is referenced by a branch head. This branch head moves forward as further commits are made in that branch.
TODO: When merging, the tips of two branches are unified in a new commit object.
Integrate changes from one branch into another
There are two main commands to intergrate changes from one branch into another:
git show the-name-of-the-other-branch:path/to/file.txt
head
A named reference to the commit at the tip of a branch, stored in the .git/refs/heads directory (except when using packed refs).
A synonym for head is head ref.
index
A collection of files with stat information, whose contents are stored as objects. The index is a stored version of your working tree. Truth be told, it can also contain a second, a even a third version of a working tree, which are used when merging.
index entry
The information regarding a particular file, stored in the index. An index entry can be unmerged, if a merge was started but not finished (i.e. if the index contains multiple versions of that file).
topic branch
A branch that is used by a developer to identifiy a conceptual line of development. Since branches are very easy and inexpensive, it is often desirable to have several small branches that each contain very well defined concepts or smallincremental yet related changes.
To find the tip of a topic branch, run git log --first-parent master..pu and look for the merge commit. The second parent of this commit is the tip of the topic branch.
Any checkout of a commit that is not the name of one of your branches will get you a detached HEAD (i.e. by checking out a remote branch without first tracking it.
Upstream branch
Apparently, a branch can be associated with an upstream branch:
$ git branch
* fixSomething
master
$ git push origin
fatal: The current branch fixUsage has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin fixSomething
Unborn branch
The documentation for git diff makes reference to an «unborn branch», whatever that is.