Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether...

46
Git

Transcript of Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether...

Page 1: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Git

Page 2: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Git Reference

http://gitref.org/

Page 3: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 4: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Pro Githttp://git-scm.com/book

Page 5: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 6: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 7: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 8: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 9: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 10: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 11: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 12: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

How to think like Git

Page 13: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 14: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 15: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 16: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 17: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

this is all Git is

Page 18: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The Git Object Model

Page 19: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The SHA

6ff87c4664981e4397625791c8ea3bbb5f2279a3

Page 20: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The SHA: why it's awesome

● Git can quickly determine whether two objects are identical or not, just by comparing names.

Page 21: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The SHA: why it's awesome

● Git can quickly determine whether two objects are identical or not, just by comparing names.

● Since object names are computed the same way in every repository, the same content stored in two repositories will always be stored under the same name.

Page 22: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The SHA: why it's awesome

● Git can quickly determine whether two objects are identical or not, just by comparing names.

● Since object names are computed the same way in every repository, the same content stored in two repositories will always be stored under the same name.

● For the same reason, different content created in two different repositories will never have conflicting names.

Page 23: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The SHA: why it's awesome

● Git can quickly determine whether two objects are identical or not, just by comparing names.

● Since object names are computed the same way in every repository, the same content stored in two repositories will always be stored under the same name.

● For the same reason, different content created in two different repositories will never have conflicting names.

● Git can detect errors when it reads an object by checking that the object's name is still the SHA1 hash of its contents.

Page 24: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The SHA: why it's awesome

● Git can quickly determine whether two objects are identical or not, just by comparing names.

● Since object names are computed the same way in every repository, the same content stored in two repositories will always be stored under the same name.

● For the same reason, different content created in two different repositories will never have conflicting names.

● Git can detect errors when it reads an object by checking that the object's name is still the SHA1 hash of its contents.

Page 25: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Blobs

● Content only (no filenames)● Single revision (changes are

represented as new blobs)

Page 26: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Trees

● Directory hierarchy and filenames● Single revision (changes are

represented as new trees which might reference existing trees and blobs)

Page 27: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Commits

● Annotated top-level tree● Most prominent object in day-to-

day use

Page 28: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 29: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Tags

● Attaches an arbitrary name to an object (usually a commit)

● Commonly used for releases

Page 30: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The Git Repository

and some day-to-day examples

Page 31: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The .git directory

Page 32: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The working directory

Page 33: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Committing a file

Page 34: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Committing a file

Page 35: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The git index

Page 36: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

The git index

Page 37: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

http://ericsink.com/vcbe/html/directed_acyclic_graphs.html

Page 38: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Remote Repositories, multiple branches, and merging

Page 39: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Remote repositories

Page 40: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

Remote repositories

Page 41: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 42: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 43: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 44: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 45: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are
Page 46: Gitresearchcomputing.github.io/meetup_spring_2015/pdfs/Git.pdf · Git can quickly determine whether two objects are identical or not, just by comparing names. Since object names are

GitX-devhttp://rowanj.github.io/gitx/

TortoiseGithttps://code.google.com/p/tortoisegit/

GitHub.com