From aaaf6ed10b62e888fc6a29df5e5d5f8295e25283 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 16 Aug 2013 08:56:37 +0200 Subject: the trees of git MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- using-git.texinfo | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'using-git.texinfo') diff --git a/using-git.texinfo b/using-git.texinfo index c3f8ae7..74bf8b9 100644 --- a/using-git.texinfo +++ b/using-git.texinfo @@ -54,6 +54,7 @@ Texts. A copy of the license is included in the section entitled * Introduction:: * Branching out:: * Collaborating:: +* Basic commands:: * GNU Free Documentation License:: @end menu @@ -613,6 +614,58 @@ you want to see the changes. +@node Basic commands +@chapter Basic commands + +@menu +* The trees of Git:: +@end menu + + + +@node The trees of Git +@section The trees of Git + +Git has four trees should know about +to better understand how Git works. + +The first tree you encounter is the +working directory. The tree begins +in the parent so called git directory; +the directory you executed +@command{git init} in, and contains +the directory @file{.git}. + +When you are using @command{git add} +to stage files you encounter the next +tree. This tree is called the index, +and is separate from the working +directory, when you stage a file, +you stage an edit, if you edit the +file further those changes does not +make it into the index until you +restage the file. + +When you have done some work --- +just a small logical step is recommended +--- and want to save your changes you +commit then with @command{git commit}. +This is when you encounter the third +tree, the @code{HEAD}. @code{HEAD} is +the file tree of the last commit, and +it is updated when make a commit. + +The fourth tree is not a file tree, +it is the commit tree. The important +thing with Git is that this tree is +not linear, it is a directed acyclic +graph, so it is not really a tree, +but you can think of it as one because +you are normally only interested +in the leaves, your branches. + + + @node GNU Free Documentation License @appendix GNU Free Documentation License @include fdl.texinfo -- cgit v1.2.3-70-g09d2