lab - how to git
DESCRIPTION
We'll cover the basics of how to use Git , the basics of distributed versioning in Perforce , and gain an understanding of the tradeoffs between the twoTRANSCRIPT
#
By m@
Lrn2git
#
What is Git?
#
A distributed version control system
#
A decentralized version control system
#
Mercurial, Bitkeeper, Fossil, Darcs, P4 (soon!)
#
Why Git?
#
A picture of Linus Torvald
#
Local. Fast. No meddling admins.
#
Low level view
#
#
Blobs, trees, & commits
#
Blobs
#
Trees
#
Commits
#
Everything is a SHA
#
History is immutable
#
(Except when it's not.)
#
What is Git?
#
The Basics
#
4 commands you can't live without
#
Init, add, commit, config
#
Init, reconcile, submit, set
#
git initgit config user.name "Jane Doe"git config user.email [email protected] foo.txtgit add .git commit -m 'My first commit'
#
Important differences
#
Unopened, pending or submittedvs
Unstaged, staged, or committed
#
Git add "stages" files
#
What's a stage?
#
echo cake > foo.txtgit add .echo pie >> foo.txtgit commit -m 'What did I commit?'
#
cake
#
4 commands you have to know if you want to work with other people
#
Clone, push, pull, remotes
#
Clone, push, pull, remotes
#
You won't believe how easy it is to branch your code
#
Checkout
#
Switch?
#
Make all your mistakes disappear using these simple tricks
#
Reset, amend, rebase
#
Revert, uncommit
#
Reset
#
Reset --soft
#
Reset --hard
#
Commit --amend
#
Rebase
#
Dive in!
#
http://git-scm.com
#
Resources
Try Git at CodeSchoolGit Flight RulesGit Koans