A git Primer
danielmiessler.com
danielmiessler.com
"The command’s second form creates a new branch head named <branchname> which points to the current HEAD, or <start-point> if given."
So after a git branch command, the test branch still points to the same commit as HEAD.
You have to make an additional commit for them to diverge.
Big things:
Explaining that the object name (d56abc..) is really a SHA1 hash of all the contents. Git then uses this name to uniquely identify Git Objects.
Git Objects consist of: blob (file), tree (directory), commit (pointer), tag (well.. its a tag..). When you do a "git checkout" you interact with commit objects. When you do a "git ls-tree master ." you are looking at a tree object.
Branching is done by putting the following in .git/refs/heads/branch_name: d56abc..
And a branch will always just point to a commit object.
Finally, the working directory is of very little concern to git. It has handy functions to drop some of its stuff there for you and it can tell you some differences between its HEAD and your files, but really Git begins at the Index.
+ Lots of little things.
Edit: It is always fun to do a quick 'echo "dbc123.." >> .git/refs/heads/new_branch' and show someone that that is all it takes. It really quickly shows how not-scary git is. There is a ton of complex technology that enables its awesomeness but it is a relatively simple system.
The first commit is missing it's 't', which it looks like the second one stole.
EDIT: Actually, you just have a copy-paste error.
"the index is your staging area where things go after using git add before they get committed."
That's not right. The index is where things go after MAKING EDITS IN THE WORKING DIRECTORY before they get committed. (What does "after using git" even mean?)
It's "after using `git add', before they get committed", which is correct, the `git add' command adds a file to the index.