Add notes on branches, merging, tagging, and update some of the usage to
the friendlier "git cmd" syntax.
It's still ridiculously lacking, but perhaps it's a _bit_ more useful.
@ -215,6 +215,12 @@ In other words, git-diff-files always shows us the difference between
@@ -215,6 +215,12 @@ In other words, git-diff-files always shows us the difference between
what is recorded in the index, and what is currently in the working
tree. That's very useful.
A common shorthand for "git-diff-files -p" is to just write
git diff
which will do the same thing.
Committing git state
--------------------
@ -275,6 +281,14 @@ for a project ever, and all later commits will be parented on top of an
@@ -275,6 +281,14 @@ for a project ever, and all later commits will be parented on top of an
earlier commit, and you'll never see this "Committing initial tree"
message ever again.
Again, normally you'd never actually do this by hand. There is a
helpful script called "git commit" that will do all of this for you. So
you could have just writtten
git commit
instead, and it would have done the above magic scripting for you.
Making a change
---------------
@ -313,6 +327,13 @@ Now we're comparing the working directory not against the index file,
@@ -313,6 +327,13 @@ Now we're comparing the working directory not against the index file,
but against the tree we just wrote. It just so happens that those two
are obviously the same, so we get the same result.
Again, because this is a common operation, you can also just shorthand
it with
git diff HEAD
which ends up doing the above for you.
In other words, "git-diff-cache" normally compares a tree against the
working directory, but when given the "--cached" flag, it is told to
instead compare against just the index cache contents, and ignore the
@ -354,16 +375,17 @@ current state is different from the state we committed. In fact, now
@@ -354,16 +375,17 @@ current state is different from the state we committed. In fact, now
flag or not, since now the index is coherent with the working directory.
Now, since we've updated "a" in the index, we can commit the new
version. We could do it by writing the tree by hand, and committing the
tree (this time we'd have to use the "-p HEAD" flag to tell commit that
the HEAD was the _parent_ of the new commit, and that this wasn't an
initial commit any more), but the fact is, git has a simple helper
script for doing all of the non-initial commits that does all of this
for you, and starts up an editor to let you write your commit message
yourself, so let's just use that:
version. We could do it by writing the tree by hand again, and
committing the tree (this time we'd have to use the "-p HEAD" flag to
tell commit that the HEAD was the _parent_ of the new commit, and that
this wasn't an initial commit any more), but you've done that once
already, so let's just use the helpful script this time:
git commit
which starts an editor for you to write the commit message and tells you
a bit about what you're doing.
Write whatever message you want, and all the lines that start with '#'
will be pruned out, and the rest will be used as the commit message for
the change. If you decide you don't want to commit anything after all at
@ -532,7 +554,219 @@ older version of a checked out tree you may also need to add the "-f"
@@ -532,7 +554,219 @@ older version of a checked out tree you may also need to add the "-f"
file first, to tell git-checkout-cache to _force_ overwriting of any old