<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
<head>\r
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
-<meta name="generator" content="AsciiDoc 7.0.1" />\r
+<meta name="generator" content="AsciiDoc 7.0.2" />\r
<style type="text/css">\r
/* Debug borders */\r
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {\r
<ul>\r
<li>\r
<p>\r
-a symlink called <tt>HEAD</tt>, pointing to <tt>refs/heads/master</tt> (if your\r
- platform does not have native symlinks, it is a file containing the\r
- line "ref: refs/heads/master")\r
+a file called <tt>HEAD</tt>, that has <tt>ref: refs/heads/master</tt> in it.\r
+ This is similar to a symbolic link and points at\r
+ <tt>refs/heads/master</tt> relative to the <tt>HEAD</tt> file.\r
</p>\r
<p>Don't worry about the fact that the file that the <tt>HEAD</tt> link points to\r
doesn't even exist yet — you haven't created the commit that will\r
<em>tags</em> that you have created to name specific versions in your\r
repository.</p>\r
<p>One note: the special <tt>master</tt> head is the default branch, which is\r
-why the <tt>.git/HEAD</tt> file was created as a symlink to it even if it\r
+why the <tt>.git/HEAD</tt> file was created points to it even if it\r
doesn't yet exist. Basically, the <tt>HEAD</tt> link is supposed to always\r
point to the branch you are working on right now, and you always\r
start out expecting to work on the <tt>master</tt> branch.</p>\r
<pre><tt>$ echo "Hello World" >hello\r
$ echo "Silly example" >example</tt></pre>\r
</div></div>\r
-<p>you have now created two files in your working tree (aka <em>working directory</em>), but to\r
-actually check in your hard work, you will have to go through two steps:</p>\r
+<p>you have now created two files in your working tree (aka <em>working directory</em>),\r
+but to actually check in your hard work, you will have to go through two steps:</p>\r
<ul>\r
<li>\r
<p>\r
<pre><tt>.git/objects/55/7db03de997c86a4a028e1ebd3a1ceb225be238\r
.git/objects/f2/4c74a2e500f5ee1332c86b94199f52b1d1d962</tt></pre>\r
</div></div>\r
-<p>which correspond with the objects with names of 557db… and f24c7..\r
-respectively.</p>\r
+<p>which correspond with the objects with names of <tt>557db…</tt> and\r
+<tt>f24c7…</tt> respectively.</p>\r
<p>If you want to, you can use <tt>git-cat-file</tt> to look at those objects, but\r
you'll have to use the object name, not the filename of the object:</p>\r
<div class="listingblock">\r
<div class="content">\r
<pre><tt>$ git-cat-file "blob" 557db03</tt></pre>\r
</div></div>\r
-<p>which will print out "Hello World". The object 557db03 is nothing\r
+<p>which will print out "Hello World". The object <tt>557db03</tt> is nothing\r
more than the contents of your file <tt>hello</tt>.</p>\r
<div class="admonitionblock">\r
<table><tr>\r
</td>\r
</tr></table>\r
</div>\r
-<p>More interestingly, you can also give <tt>git-diff-tree</tt> the <tt>-v</tt> flag, which\r
-tells it to also show the commit message and author and date of the\r
+<p>More interestingly, you can also give <tt>git-diff-tree</tt> the <tt>—pretty</tt> flag,\r
+which tells it to also show the commit message and author and date of the\r
commit, and you can tell it to show a whole series of diffs.\r
Alternatively, you can tell it to be "silent", and not show the diffs at\r
all, but just show the actual commit message.</p>\r
branch you happen to be on, a simple</p>\r
<div class="listingblock">\r
<div class="content">\r
-<pre><tt>$ ls -l .git/HEAD</tt></pre>\r
-</div></div>\r
-<p>will tell you where it's pointing (Note that on platforms with bad or no\r
-symlink support, you have to execute</p>\r
-<div class="listingblock">\r
-<div class="content">\r
<pre><tt>$ cat .git/HEAD</tt></pre>\r
</div></div>\r
-<p>instead). To get the list of branches you have, you can say</p>\r
+<p>will tell you where it's pointing. To get the list of branches\r
+you have, you can say</p>\r
<div class="listingblock">\r
<div class="content">\r
<pre><tt>$ git branch</tt></pre>\r
</div></div>\r
<p>Here, we just added another line to <tt>hello</tt>, and we used a shorthand for\r
doing both <tt>git-update-index hello</tt> and <tt>git commit</tt> by just giving the\r
-filename directly to <tt>git commit</tt>. The <tt>-m</tt> flag is to give the\r
+filename directly to <tt>git commit</tt>, with an <tt>-i</tt> flag (it tells\r
+git to <em>include</em> that file in addition to what you have done to\r
+the index file so far when making the commit). The <tt>-m</tt> flag is to give the\r
commit log message from the command line.</p>\r
<p>Now, to make it a bit more interesting, let's assume that somebody else\r
does some work in the original branch, and simulate that by going back\r
...\r
Auto-merging hello\r
CONFLICT (content): Merge conflict in hello\r
- Automatic merge failed/prevented; fix up by hand</tt></pre>\r
+ Automatic merge failed; fix up by hand</tt></pre>\r
</div></div>\r
<p>which is way too verbose, but it basically tells you that it failed the\r
really trivial merge ("Simple merge") and did an "Automatic merge"\r
environment, is <tt>git show-branch</tt>.</p>\r
<div class="listingblock">\r
<div class="content">\r
-<pre><tt>$ git show-branch master mybranch\r
+<pre><tt>$ git show-branch --topo-order master mybranch\r
* [master] Merge work in mybranch\r
! [mybranch] Some work.\r
--\r
<div class="listingblock">\r
<div class="content">\r
<pre><tt>Updating from ae3a2da... to a80b4aa....\r
+Fast forward\r
example | 1 +\r
hello | 1 +\r
2 files changed, 2 insertions(+), 0 deletions(-)</tt></pre>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 30-Jan-2006 23:10:20 PDT\r
+Last updated 07-Feb-2006 03:24:18 UTC\r
</div>\r
</div>\r
</body>\r
inspect that with `ls`. For your new empty project, it should show you
three entries, among other things:
- - a symlink called `HEAD`, pointing to `refs/heads/master` (if your
- platform does not have native symlinks, it is a file containing the
- line "ref: refs/heads/master")
+ - a file called `HEAD`, that has `ref: refs/heads/master` in it.
+ This is similar to a symbolic link and points at
+ `refs/heads/master` relative to the `HEAD` file.
+
Don't worry about the fact that the file that the `HEAD` link points to
doesn't even exist yet -- you haven't created the commit that will
repository.
One note: the special `master` head is the default branch, which is
-why the `.git/HEAD` file was created as a symlink to it even if it
+why the `.git/HEAD` file was created points to it even if it
doesn't yet exist. Basically, the `HEAD` link is supposed to always
point to the branch you are working on right now, and you always
start out expecting to work on the `master` branch.
$ echo "Silly example" >example
------------------------------------------------
-you have now created two files in your working tree (aka 'working directory'), but to
-actually check in your hard work, you will have to go through two steps:
+you have now created two files in your working tree (aka 'working directory'),
+but to actually check in your hard work, you will have to go through two steps:
- fill in the 'index' file (aka 'cache') with the information about your
working tree state.
.git/objects/f2/4c74a2e500f5ee1332c86b94199f52b1d1d962
----------------
-which correspond with the objects with names of 557db... and f24c7..
-respectively.
+which correspond with the objects with names of `557db...` and
+`f24c7...` respectively.
If you want to, you can use `git-cat-file` to look at those objects, but
you'll have to use the object name, not the filename of the object:
$ git-cat-file "blob" 557db03
----------------
-which will print out "Hello World". The object 557db03 is nothing
+which will print out "Hello World". The object `557db03` is nothing
more than the contents of your file `hello`.
[NOTE]
+-----------+
============
-More interestingly, you can also give `git-diff-tree` the `-v` flag, which
-tells it to also show the commit message and author and date of the
+More interestingly, you can also give `git-diff-tree` the `--pretty` flag,
+which tells it to also show the commit message and author and date of the
commit, and you can tell it to show a whole series of diffs.
Alternatively, you can tell it to be "silent", and not show the diffs at
all, but just show the actual commit message.
branch you happen to be on, a simple
------------
-$ ls -l .git/HEAD
-------------
-
-will tell you where it's pointing (Note that on platforms with bad or no
-symlink support, you have to execute
-
-------------
$ cat .git/HEAD
------------
-instead). To get the list of branches you have, you can say
+will tell you where it's pointing. To get the list of branches
+you have, you can say
------------
$ git branch
Here, we just added another line to `hello`, and we used a shorthand for
doing both `git-update-index hello` and `git commit` by just giving the
-filename directly to `git commit`. The `-m` flag is to give the
+filename directly to `git commit`, with an `-i` flag (it tells
+git to 'include' that file in addition to what you have done to
+the index file so far when making the commit). The `-m` flag is to give the
commit log message from the command line.
Now, to make it a bit more interesting, let's assume that somebody else
...
Auto-merging hello
CONFLICT (content): Merge conflict in hello
- Automatic merge failed/prevented; fix up by hand
+ Automatic merge failed; fix up by hand
----------------
which is way too verbose, but it basically tells you that it failed the
environment, is `git show-branch`.
------------------------------------------------
-$ git show-branch master mybranch
+$ git show-branch --topo-order master mybranch
* [master] Merge work in mybranch
! [mybranch] Some work.
--
----------------
Updating from ae3a2da... to a80b4aa....
+Fast forward
example | 1 +
hello | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)