Leto and I got chromatic to actually use github today at OS Bridge. In the process of explaining it to him I drew up the most useful diagram of git you will ever see. It illustrates the five layers (stash, working copy, staging area, local repo, remote repo), how you move changes between them and what layers different invocations of diff act on.
I wish someone had shown me this months ago.
UPDATE: Of course I'm not the first person to think of this. Here's a much cleaner version of what I did from an article about the git workflow.
The preview copy of the O'reilly book on git had some great diagrams as well of how the object model works and the DAG.
What I finally grokked is that the stash is just the NEXT NODE in the DAG before it's been hooked onto the end. All a commit does is set the stash's parent pointer equal to the current branch pointer and set the current branch pointer equal to the stash.
It's not really an "extra layer" -- it's just the next node under construction.
Re:O'reilly book
jand on 2009-06-23T19:16:35
You mean the "cache", not the "stash", right?Re:O'reilly book
dagolden on 2009-06-23T19:34:15
Yes. Cache/index.Re:O'reilly book
jand on 2009-07-05T08:24:48
I only mentioned this because git does have the concept of a stash (`git help stash`), which is distinct from the cache/index; I wasn't just nitpicking on the words.Re:O'reilly book
dagolden on 2009-07-05T10:22:04
No problem. I didn't think you were nitpicking.:-)
Scott Chacon's talk about Git at the Ruby conferences has very pretty diagrams.