On Github changyuheng / slides-revision-control-using-git-the-practical-way
Created by Chang Yu-heng (張昱珩)
2014-06-09
hello.py
doesn't make sense
hello.py
hello.py
hello.py
融…合
diff
Patch 1
Patch 2
3-way merge
hello.py still doesn't print "hello"
Forget it!
A commit is a snapshot of your repository.
The direction of the arrow means: "derived from".
The graph means B derived from A.
Each commit only knows its parent(s).
It has no idea about its child(rden).
Cause the child(ren) not even born yet. So it cannot point to its child(ren).
If you want to do this:
You have to update B on each time a new child of B being born.
Doesn't make sense.
Branches are just pointers which point to specific commits
"master" is a branch which points to commit "f30ab".
Different branches can point to the same commit.
So just branch it. It's cheap.
"HEAD" represents which branch/commit your are at now.
To "checkout" another branch/commit is easy. Just move your "HEAD".
With branches, you can keep different version of your work in the same repository.