lab - how to git

46
# By m@ Lrn2git

Upload: perforce

Post on 22-Apr-2015

154 views

Category:

Technology


0 download

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 two

TRANSCRIPT

Page 1: LAB - How to Git

#

By m@

Lrn2git

Page 2: LAB - How to Git

#

What is Git?

Page 3: LAB - How to Git

#

A distributed version control system

Page 4: LAB - How to Git

#

A decentralized version control system

Page 5: LAB - How to Git

#

Mercurial, Bitkeeper, Fossil, Darcs, P4 (soon!)

Page 6: LAB - How to Git

#

Why Git?

Page 7: LAB - How to Git

#

A picture of Linus Torvald

Page 8: LAB - How to Git

#

Local. Fast. No meddling admins.

Page 9: LAB - How to Git

#

Low level view

Page 10: LAB - How to Git

#

Page 11: LAB - How to Git

#

Blobs, trees, & commits

Page 12: LAB - How to Git

#

Blobs

Page 13: LAB - How to Git

#

Trees

Page 14: LAB - How to Git

#

Commits

Page 15: LAB - How to Git

#

Everything is a SHA

Page 16: LAB - How to Git

#

History is immutable

Page 17: LAB - How to Git

#

(Except when it's not.)

Page 18: LAB - How to Git

#

What is Git?

Page 19: LAB - How to Git

#

The Basics

Page 20: LAB - How to Git

#

4 commands you can't live without

Page 21: LAB - How to Git

#

Init, add, commit, config

Page 22: LAB - How to Git

#

Init, reconcile, submit, set

Page 23: LAB - How to Git

#

git initgit config user.name "Jane Doe"git config user.email [email protected] foo.txtgit add .git commit -m 'My first commit'

Page 24: LAB - How to Git

#

Important differences

Page 25: LAB - How to Git

#

Unopened, pending or submittedvs

Unstaged, staged, or committed

Page 26: LAB - How to Git

#

Git add "stages" files

Page 27: LAB - How to Git

#

What's a stage?

Page 28: LAB - How to Git

#

echo cake > foo.txtgit add .echo pie >> foo.txtgit commit -m 'What did I commit?'

Page 29: LAB - How to Git

#

cake

Page 30: LAB - How to Git

#

4 commands you have to know if you want to work with other people

Page 31: LAB - How to Git

#

Clone, push, pull, remotes

Page 32: LAB - How to Git

#

Clone, push, pull, remotes

Page 33: LAB - How to Git

#

You won't believe how easy it is to branch your code

Page 34: LAB - How to Git

#

Checkout

Page 35: LAB - How to Git

#

Switch?

Page 36: LAB - How to Git

#

Make all your mistakes disappear using these simple tricks

Page 37: LAB - How to Git

#

Reset, amend, rebase

Page 38: LAB - How to Git

#

Revert, uncommit

Page 39: LAB - How to Git

#

Reset

Page 40: LAB - How to Git

#

Reset --soft

Page 41: LAB - How to Git

#

Reset --hard

Page 42: LAB - How to Git

#

Commit --amend

Page 43: LAB - How to Git

#

Rebase

Page 44: LAB - How to Git

#

Dive in!

Page 45: LAB - How to Git

#

http://git-scm.com

Page 46: LAB - How to Git

#

Resources

Try Git at CodeSchoolGit Flight RulesGit Koans