Getting git
Or, How I Learned To Stop Worrying And Love The DAG
It's gonna get weird
We're going to use very uncommon git commands you may never see again; don't worry about it.
git init
Create a new git repository!
git init
But what's inside?
git init
But what's inside?
git add
Staging/Caching/Indexing your files
git add
git commit
Create our second object
What just happened?
Commits
Trees
Blobs
What just happened?
We created a commit object
We created a tree object
We created two blob objects
We updated HEAD to point to the new commit (which has a reference to its parent)
Annotated Tag object
You said there were four object types...
Annotated Tag object
git branch
Starting development
git branch
git Checkout
Moving HEAD
git Checkout
git merge
Commits with two parents
git merge
git merge
Interlude: The DAG
Its all a Directed Acyclic Graph
Interlude: The DAG
git reset
No-one ever needs to know
git reset
Nothing is ever lost
git reset
git reflog
Nothing is ever lost
git gc
Okay some things are lost sometimes
git rebase
A more elegant merge strategy
git rebase
What happened?
git commit --amend
What's in a commit'
git commit --amend
Questions?