git going with dvcs v1.5.2
DESCRIPTION
Git presentation to the Utah Java Users Group (UJUG)TRANSCRIPT
![Page 1: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/1.jpg)
by Matthew McCullough of Ambient Ideas, LLC
with DVCSGit going
50 minutes of mental spoon bending
via source code control
![Page 2: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/2.jpg)
DVCS
What? Why?
Basic Use
Who? GUI
Theory
Sharing
Interop High Points
![Page 3: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/3.jpg)
Git-nounBritish Slang. an unpleasant or
contemptible person
-Oxford English Dictionary
“
”
![Page 4: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/4.jpg)
≉
![Page 5: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/5.jpg)
![Page 6: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/6.jpg)
I'm an egotistical bastard, and
I name all my projects
after myself. First Linux,
now git.-Linus Torvalds
“
”now git.
![Page 7: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/7.jpg)
CVS
BitKeeperSubversion
PVCS
Perforce
ClearCaseSource
Safe
Mercurial
Bazaar
RCS
Folders
darcs
![Page 8: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/8.jpg)
GitSource Code Control
![Page 9: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/9.jpg)
CultureChange
![Page 10: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/10.jpg)
![Page 11: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/11.jpg)
![Page 12: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/12.jpg)
![Page 13: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/13.jpg)
CentralizedVCS =Don’t
![Page 14: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/14.jpg)
DoWhatever!DistributedVCS =
![Page 15: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/15.jpg)
InnovateExperiment
Safely Be WrongDrive-by AssistCrowd Source
![Page 16: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/16.jpg)
Crowd Source
![Page 17: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/17.jpg)
![Page 18: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/18.jpg)
① Download binaries
![Page 19: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/19.jpg)
Win Cygwin
Win msysGit
Linux Source
Linux Package manager
Mac MacPorts
Mac git-osx-installer
Any JGit
Git Distro Sources
![Page 20: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/20.jpg)
② Put it in your path
![Page 21: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/21.jpg)
![Page 22: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/22.jpg)
③ Identify yourself
![Page 23: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/23.jpg)
git config --global user.name "Hal Smith"
git config --global user.email "[email protected]"
Global Git Settings
![Page 24: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/24.jpg)
④ Use it!
![Page 25: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/25.jpg)
mkdir myproj.git
cd myproj.git
git init
Creating a Repo
![Page 26: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/26.jpg)
Just show it to me!
![Page 27: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/27.jpg)
![Page 28: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/28.jpg)
![Page 29: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/29.jpg)
CertifiedGit User
![Page 30: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/30.jpg)
![Page 31: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/31.jpg)
145+ Commands
![Page 32: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/32.jpg)
Follow theDOTS
![Page 33: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/33.jpg)
Symmetric
![Page 34: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/34.jpg)
subversion server
developer A developer B
![Page 35: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/35.jpg)
chec
k in
![Page 36: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/36.jpg)
update
![Page 37: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/37.jpg)
![Page 38: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/38.jpg)
check in
![Page 39: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/39.jpg)
upda
te
![Page 40: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/40.jpg)
![Page 41: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/41.jpg)
Symmetric
![Page 42: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/42.jpg)
Distributed
![Page 43: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/43.jpg)
developer A developer B
![Page 44: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/44.jpg)
blessed repo
developer A developer B
![Page 45: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/45.jpg)
commitcommitcommit
commitcommit
commit commit
![Page 46: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/46.jpg)
delete delete
![Page 47: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/47.jpg)
rebase
![Page 48: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/48.jpg)
push
![Page 49: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/49.jpg)
push
![Page 50: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/50.jpg)
push
![Page 51: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/51.jpg)
push
![Page 52: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/52.jpg)
pull
![Page 53: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/53.jpg)
pull
![Page 54: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/54.jpg)
Distributed
![Page 55: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/55.jpg)
WorkingOffline
![Page 56: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/56.jpg)
![Page 57: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/57.jpg)
More available connectivity
![Page 58: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/58.jpg)
![Page 59: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/59.jpg)
More demand to work without connectivity
![Page 60: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/60.jpg)
CheckinAddBranchList change logGrep historyRewrite historyStashMergeLabelRemovepractically everything but push
Offline Anything
![Page 61: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/61.jpg)
Cool! Another commit to my latest OSS
project using Git!
I liked subversion better...
![Page 62: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/62.jpg)
DVCS
What? Why?
Basic Use
Who? GUIs
Theory
Sharing
Interop High Points
![Page 63: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/63.jpg)
Who’s Got Git?
![Page 64: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/64.jpg)
![Page 65: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/65.jpg)
![Page 66: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/66.jpg)
![Page 67: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/67.jpg)
![Page 68: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/68.jpg)
![Page 69: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/69.jpg)
GUIs
![Page 70: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/70.jpg)
GitX
![Page 71: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/71.jpg)
GitSafe
![Page 72: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/72.jpg)
GitK
![Page 73: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/73.jpg)
GitGUI
![Page 74: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/74.jpg)
EGit
![Page 75: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/75.jpg)
![Page 76: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/76.jpg)
It’s Officia
l!
![Page 77: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/77.jpg)
UsageModels
![Page 78: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/78.jpg)
Central Repo
Ce
nt
ra
liz
ed
![Page 79: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/79.jpg)
Blessed Repo
Dic
ta
to
rs
hip
![Page 80: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/80.jpg)
Certified Repo
Development Repo
Int
eg
ra
tio
n M
an
ag
ed
![Page 81: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/81.jpg)
Mirror
Development Repo
Mir
ro
re
d
Mirror
Certified Repo
![Page 82: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/82.jpg)
Cu
st
om
+ P
ub
lic
Co
nt
rib
Customized
☚ P
riva
te
Pub
lic ☛
GitHub
![Page 83: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/83.jpg)
Hashes and Git
![Page 84: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/84.jpg)
‣Centralized VCS uses DB sequential index.
Index vs Hash
![Page 85: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/85.jpg)
‣Git uses SHA-1 hash.
Index vs Hash
![Page 86: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/86.jpg)
I thought
hashes were
for
passwords?
![Page 87: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/87.jpg)
‣ Different goals.‣ Hash for the sake of integrity.‣ Hash for the sake of identity.
SHA-1 Hash
![Page 88: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/88.jpg)
40 hex characters
![Page 89: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/89.jpg)
Use as little of it as is unique
![Page 90: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/90.jpg)
Treeish
![Page 91: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/91.jpg)
Shorthand for the hashes
![Page 92: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/92.jpg)
9AB223
![Page 93: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/93.jpg)
9AB223^
![Page 94: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/94.jpg)
9AB223..56CD77
![Page 95: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/95.jpg)
HEAD
![Page 96: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/96.jpg)
HEAD^
![Page 97: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/97.jpg)
HEAD~3
![Page 98: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/98.jpg)
But I’ve been
hearing news
about hash
collisions...
![Page 99: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/99.jpg)
earth atoms10
49
![Page 100: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/100.jpg)
SHA11046
![Page 101: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/101.jpg)
stars10
22
![Page 102: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/102.jpg)
sand grains10
20
![Page 103: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/103.jpg)
collision10
19
![Page 104: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/104.jpg)
‣Blob‣Tree‣Commit‣Tag
Hashable Objects
![Page 105: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/105.jpg)
http://book.git-scm.com/1_the_git_object_model.html
![Page 106: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/106.jpg)
Integrity‣ Identifies damaged repos.‣ Prevents modification of published history.‣ Unique to file size and contents.
Hash Benefits
![Page 107: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/107.jpg)
Tags‣ Cryptographically sign tags by GPG.‣ Guarantee repo’s state at a point in time.
Hash Benefits
![Page 108: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/108.jpg)
Storage Mechanics
![Page 109: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/109.jpg)
Typical SCMs use delta storage
![Page 110: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/110.jpg)
CVS / Subversion / darcs / Mercurial
![Page 111: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/111.jpg)
Checkin
Checkin Checkin Che
ckin
Che
ckin
Che
ckin
Che
ckin
Che
ckin
Check
in
Checkin
Checkin
Delta storage gets slower as the history of a file gets longer
![Page 112: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/112.jpg)
Git uses DAG storage
![Page 113: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/113.jpg)
Directed Acyclic Graph
![Page 114: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/114.jpg)
Copy of the entire tree per checkin
![Page 115: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/115.jpg)
cp -r srcfolder srcfolder.prev
![Page 116: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/116.jpg)
![Page 117: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/117.jpg)
Sounds inefficient...
![Page 118: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/118.jpg)
zlib deflates every blob at commit
![Page 119: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/119.jpg)
I’ve had a
400MB Subversion repo
convert to a 70MB Git repo
![Page 120: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/120.jpg)
Speed
![Page 121: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/121.jpg)
git: git
hg: mercurial
bzr: bazaar
![Page 122: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/122.jpg)
data from http://whygitisbetterthanx.com/#git-is-fast
git hg bzr
Init
git hg bzr
Add
git hg bzr
Status
git hg bzr
Diff
git hg bzr
Tag
git hg bzr
Log
git hg bzr
Commit (Lg)
git hg bzr
Commit (Sm)
git c git h hg c hg h bzr c bzr h
Branch (Cold/Hot)
![Page 123: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/123.jpg)
bazaar numbers plus network latency
subversion =
![Page 124: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/124.jpg)
to100 timesFaster
10
![Page 125: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/125.jpg)
Location,Location,Location
![Page 126: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/126.jpg)
Three Stage Thinkingof Git
![Page 127: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/127.jpg)
Git‣ git add‣ git commit‣ git push
![Page 128: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/128.jpg)
‣ Commits only what is added to the index.‣ Opportunity to rewrite history locally.‣ Provides time to change your mind.‣ Selectively share with other repos.
![Page 129: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/129.jpg)
Git‣ git stash‣ git stash apply
![Page 130: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/130.jpg)
‣ Save work-in-progress temporarily, but safely.
‣ Merge stashed modifications back in.
![Page 131: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/131.jpg)
Repo
is like a special
IndexWorking
Stash
git clone
git checkout
edit experiment files
git stash
test buggy files
git stash apply
git add
git commit
Rem
ote
git push
![Page 132: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/132.jpg)
git clone git://somedomain/myproj.gitcd myproj.git
git checkout master
echo ‘//Comments’ >> ClassOne.javaecho ‘//Thoughts’ >> ClassTwo.java
git add ClassOne.javagit commit -m’Added comments’
git stash
◀Build repo
◀Update index
◀Edit working
◀Add to index
◀Save to repo
◀Push to stash
![Page 133: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/133.jpg)
Merge & Rebase
![Page 134: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/134.jpg)
git branch newbranchgit checkout -b newer remote/branchnm
Cheap Branches
![Page 135: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/135.jpg)
git show-branch --allgit branch -a
Cheap Branches
![Page 136: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/136.jpg)
‣Local branch‣localbranchname
‣Remote branch‣remote/branchname
![Page 137: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/137.jpg)
git merge --no-commit <sourcebranch>git merge --squash <sourcebranch>git merge <sourcebranch1> <sourcebranch2>
Merge Anything
![Page 138: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/138.jpg)
git checkout myfeaturebranchgit rebase master
Rebase for Clarity
![Page 139: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/139.jpg)
‣Fast forwards the “side” branch.‣Reposition your feature branch’s start point.
‣See “how trunk will act” before you merge.
‣Makes for simpler merge graphs.‣Cleaner history than a merge.
Rebase for Clarity
![Page 140: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/140.jpg)
Standard
Mergea32
2e2
e69
d19
8b3
Branch
Mas
ter/
Trun
k/M
ainL
ates
t
9f1Merg
e
![Page 141: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/141.jpg)
Rebasing
a32
2e2
e69
d19
8b3
Branch
Mas
ter/
Trun
k/M
ainL
ates
t
![Page 142: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/142.jpg)
a32
2e2
e69
d19
8b3 Branch
Mas
ter/
Trun
k/M
ainL
ates
t
Rebase
![Page 143: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/143.jpg)
a32
2e2
e69
d19
8b3 Branch
Mas
ter/
Trun
k/M
ainL
ates
t
e69
d19 Merge
![Page 144: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/144.jpg)
DVCS
What? Why?
Basic Use
Who? GUIs
Theory
Sharing
Interop High Points
![Page 145: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/145.jpg)
Sharing
![Page 146: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/146.jpg)
Protocols‣ GIT‣ SSH‣ SCP
‣ Local file system‣ SAMBA
‣ HTTP‣ WebDAV
‣ rsync
Serving It Up
![Page 147: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/147.jpg)
git clone git://somehost.org/myproj.git
git clone [email protected]:myproj.git
git clone http://somehost.org/myproj.git
git clone ~/work/myproj.git
git clone z:\someserver\myproj.git
◀git daemon
◀SSH
◀HTTP
◀Filesystem
◀Network drive
![Page 148: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/148.jpg)
‣ git instaweb. Built in, read-only, HTTP.
‣ git daemon. Custom socket language.
‣ gitosis. Easy permissions control.
‣ github. Open source & private repos.
‣ ssh. OS controlled permissions.
Serving It Up
![Page 149: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/149.jpg)
![Page 150: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/150.jpg)
![Page 151: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/151.jpg)
SVN Interop
![Page 152: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/152.jpg)
git svn clone http://unfurl.com/trunkgit svn dcommit
Subversion
![Page 153: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/153.jpg)
‣ First class compatibility.
‣ Round trip support.
‣ Git commits = svn commits.
Subversion
![Page 154: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/154.jpg)
![Page 155: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/155.jpg)
‣ git svn clone
Migration
![Page 156: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/156.jpg)
‣ Power off your Subversion server.
Migration
![Page 157: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/157.jpg)
reasons3
![Page 158: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/158.jpg)
❸‣git cherry-pick a5b2ee
‣Merge in just one commit.
Cherry Pick
![Page 159: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/159.jpg)
❷‣git grep SomeText HEAD^^^
‣Search blob contents history without checkouts.
Search History
![Page 160: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/160.jpg)
❶‣git bisect run mvn test
‣Binary-search for bug.
‣Manual or automated modes.
Bisect Bugs
![Page 161: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/161.jpg)
![Page 162: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/162.jpg)
emergingVersion Control System
![Page 163: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/163.jpg)
MatthewTwitter @matthewmccull
Blog http://www.ambientideas.com/blog sidebar has all my social media links
Email [email protected]
GitHub http://github.com/matthewmccullough
![Page 164: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/164.jpg)
Git Homepagehttp://git-scm.com
Directed Acrylic Graphhttp://en.wikipedia.org/wiki/Directed_acyclic_graph
Git for Computer Scientistshttp://eagain.net/articles/git-for-computer-scientists/
Git Treeishhttp://book.git-scm.com/4_git_treeishes.html
Resources
![Page 165: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/165.jpg)
Git Docshttp://www.kernel.org/pub/software/scm/git/docs/
Git Magic eBookhttp://www-cs-students.stanford.edu/~blynn/gitmagic/book.pdf
Linus Torvald’s Git talk at Googlehttp://www.youtube.com/watch?v=4XpnKHJAok8
CygWinhttp://www.cygwin.com
Resources
![Page 166: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/166.jpg)
MSysGithttp://code.google.com/p/msysgit
Git Cheetahhttp://code.google.com/p/msysgit/wiki/GitCheetah
Matthew’s Git Bookmarkshttp://delicious.com/matthew.mccullough/git
Matthew’s Bash Prompthttp://gist.github.com/47267
Resources
![Page 167: Git Going With DVCS v1.5.2](https://reader038.vdocuments.net/reader038/viewer/2022102722/554f588bb4c905524c8b5356/html5/thumbnails/167.jpg)
‣ http://www.ambientideasphotography.com‣ http://flickr.com/photos/lenore-m/2903856664/‣ http://en.wikipedia.org/wiki/Git_(software)‣ http://flickr.com/photos/karenhorton/1583513014/‣ http://flickr.com/photos/mashdnart/2545782407/‣ http://commons.wikimedia.org/wiki/
File:Small_Boy_nuclear_test_1962.jpg‣ http://www.flickr.com/photos/knmurphy/2506896257/‣ http://www.flickr.com/photos/albyspace/1022035568/‣ http://flickr.com/photos/michaelhays/3070238360/‣ http://flickr.com/photos/d_vdm/509996632/
Image Credits