Recent Changes - Search:

Basics

Languages

Tools

OS

Resources

PmWiki

pmwiki.org

edit SideBar

Git /

Working Tree

Git keeps track of every time you commit. Each of these commits, with the associated working directory, can be considered to be growing from the previous one, and so the analogy of a tree is often used.

The simplest tree one can have will look something like:

A-B-C-D-E
        *

Where each of the letters denote a commit, A being the initial commit that created the repository, and E being the latest commit. The * here denotes the HEAD of the branch, which is a reference position. You can display the tree of your directory using Log.

This tree will have a name, which by default is master when you create a new repository. Like real trees, working trees in git can have Branches, which represent the code being split, with work being done in different directions.

When using Checkout to move around the tree, you can also call git checkout BranchName to instantly go back to the HEAD of that branch. There can be commits after a HEAD. The most common example of which being having committed something and then later decided it was not good, so reverted the HEAD position to an older commit using Reset.

Edit - History - Print - Recent Changes - Search
Page last modified on January 18, 2018, at 04:42 PM