david krmpotic: git

33
GIT git the basics right david krmpoti ć Saturday, November 28, 2009

Upload: slo-tech

Post on 01-Nov-2014

2.910 views

Category:

Education


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: David Krmpotic: Git

GITgit the basics right

david krmpotić

Saturday, November 28, 2009

Page 2: David Krmpotic: Git

What is GIT?

• source control system• distributed• offline

Saturday, November 28, 2009

Page 3: David Krmpotic: Git

Git is not....

Saturday, November 28, 2009

Page 4: David Krmpotic: Git

Git is not....

Saturday, November 28, 2009

Page 5: David Krmpotic: Git

GIT vs SVN

Saturday, November 28, 2009

Page 6: David Krmpotic: Git

Basics

Saturday, November 28, 2009

Page 7: David Krmpotic: Git

Basics

Saturday, November 28, 2009

Page 8: David Krmpotic: Git

Basic Commands

• git init• git clone• git add + git commit• git push• git pull• git log

Saturday, November 28, 2009

Page 9: David Krmpotic: Git

Git log

Saturday, November 28, 2009

Page 10: David Krmpotic: Git

Everything is local

Saturday, November 28, 2009

Page 11: David Krmpotic: Git

Staging Area (index)

• an intermediate step• allows flexibility• build commits the way you want

Saturday, November 28, 2009

Page 12: David Krmpotic: Git

Why is it better than X?

• cheap local branching• everything is local• fast• small space• staging area• any workflow• GitHub

http://whygitisbetterthanx.comSaturday, November 28, 2009

Page 13: David Krmpotic: Git

Branching

• git branch develop• git merge develop

Saturday, November 28, 2009

Page 14: David Krmpotic: Git

FAST

Saturday, November 28, 2009

Page 15: David Krmpotic: Git

Time to Take The Time!

• if you want to go faster, stop and learn GIT

Saturday, November 28, 2009

Page 16: David Krmpotic: Git

Source Control Taxonomy

Saturday, November 28, 2009

Page 17: David Krmpotic: Git

DAG (no deltas)

Saturday, November 28, 2009

Page 18: David Krmpotic: Git

Source Control Taxonomy

Saturday, November 28, 2009

Page 19: David Krmpotic: Git

Workflow

svn styleSaturday, November 28, 2009

Page 20: David Krmpotic: Git

Integration Manager Workflow

Saturday, November 28, 2009

Page 21: David Krmpotic: Git

Dictator and Lieutenants Workflow

Linux kernel developmentSaturday, November 28, 2009

Page 22: David Krmpotic: Git

Object Database

• blob• tree• commit• (tag)

Saturday, November 28, 2009

Page 23: David Krmpotic: Git

SHA

• Each object is identified by a SHA-1 hash of its contents

Saturday, November 28, 2009

Page 24: David Krmpotic: Git

Blob

Saturday, November 28, 2009

Page 25: David Krmpotic: Git

Tree

Saturday, November 28, 2009

Page 26: David Krmpotic: Git

Commit

Saturday, November 28, 2009

Page 27: David Krmpotic: Git

Saturday, November 28, 2009

Page 28: David Krmpotic: Git

Immutable objects

Saturday, November 28, 2009

Page 29: David Krmpotic: Git

Repository Internals

Saturday, November 28, 2009

Page 30: David Krmpotic: Git

Branching commands

• git branch• git checkout• git merge• git rebase

Saturday, November 28, 2009

Page 31: David Krmpotic: Git

Remotes

= remote branchThey take the form (remote)/(branch). For instance, if you wanted to see what the master branch on your origin remote looked like as of the last time you communicated with it, you would check the origin/master branch.

Saturday, November 28, 2009

Page 32: David Krmpotic: Git

Tools

Saturday, November 28, 2009

Page 33: David Krmpotic: Git

Resources

• gitready.com• O’Reilly: Version Control with Git• PeepCode: Git• whygitisbetterthanx.com• gitcasts.com/git-talk• progit.org• [email protected]

Saturday, November 28, 2009