git going with dvcs v1.3

201
by Matthew McCullough of Ambient Ideas, LLC with DVCS Git going 90 minutes of mental spoon bending via source code control

Upload: matthew-mccullough

Post on 07-May-2015

1.404 views

Category:

Education


4 download

DESCRIPTION

An updated introduction to the Git Distributed Version Control System. Be prepared to have everything you know about centralized VCS systems turned upside down, but all for the benefit of easy of use, better team-mate interactions, and more robust (guaranteed) repository integrity and uptime.

TRANSCRIPT

Page 1: Git Going With DVCS v1.3

by Matthew McCullough of Ambient Ideas, LLC

with DVCSGit going

90 minutes of mental spoon bending

via source code control

Page 2: Git Going With DVCS v1.3

Git-nounBritish Slang. an unpleasant or

contemptible person

-Oxford English Dictionary

Page 3: Git Going With DVCS v1.3
Page 4: Git Going With DVCS v1.3
Page 6: Git Going With DVCS v1.3
Page 7: Git Going With DVCS v1.3

RCS

Folders

Page 8: Git Going With DVCS v1.3

CVSPVCS

ClearCaseSource

Safe

RCS

Folders

Page 9: Git Going With DVCS v1.3

CVS

BitKeeperSubversion

PVCS

PerforceClearCaseSource

Safe

RCS

Folders

Page 10: Git Going With DVCS v1.3

CVS

BitKeeperSubversion

PVCS

PerforceClearCaseSource

Safe

Mercurial

Bazaar

RCS

Folders

darcs

Page 11: Git Going With DVCS v1.3

GitSource Code Control

Page 12: Git Going With DVCS v1.3

Git Source Code Control

Page 13: Git Going With DVCS v1.3

CultureChange

Page 14: Git Going With DVCS v1.3
Page 15: Git Going With DVCS v1.3
Page 16: Git Going With DVCS v1.3
Page 17: Git Going With DVCS v1.3
Page 18: Git Going With DVCS v1.3
Page 19: Git Going With DVCS v1.3
Page 20: Git Going With DVCS v1.3
Page 21: Git Going With DVCS v1.3
Page 22: Git Going With DVCS v1.3

CentralizedVCS =Don’t

Page 23: Git Going With DVCS v1.3

Innovate

Page 24: Git Going With DVCS v1.3

Experiment

Page 25: Git Going With DVCS v1.3

Safely Be Wrong

Page 26: Git Going With DVCS v1.3

Drive-by Assist

Page 27: Git Going With DVCS v1.3

Crowd Source

Page 28: Git Going With DVCS v1.3
Page 29: Git Going With DVCS v1.3
Page 30: Git Going With DVCS v1.3
Page 31: Git Going With DVCS v1.3

git config --global user.name "Hal Smith"

Global Git Settings

Page 32: Git Going With DVCS v1.3

git config --global user.name "Hal Smith"

git config --global user.email "[email protected]"

Global Git Settings

Page 33: Git Going With DVCS v1.3

git config --global user.name "Hal Smith"

git config --global user.email "[email protected]"

git config --list

Global Git Settings

◀Output current values

Page 34: Git Going With DVCS v1.3

mkdir myproj.git

Creating a Repo

Page 35: Git Going With DVCS v1.3

mkdir myproj.git

cd myproj.git

Creating a Repo

Page 36: Git Going With DVCS v1.3

mkdir myproj.git

cd myproj.git

git init ◀That’s it folks

!

Creating a Repo

Page 37: Git Going With DVCS v1.3
Page 38: Git Going With DVCS v1.3
Page 39: Git Going With DVCS v1.3

Who’s Got Git?

Page 40: Git Going With DVCS v1.3
Page 41: Git Going With DVCS v1.3
Page 42: Git Going With DVCS v1.3
Page 43: Git Going With DVCS v1.3
Page 44: Git Going With DVCS v1.3
Page 45: Git Going With DVCS v1.3
Page 46: Git Going With DVCS v1.3

Hashes andIntegrity

Page 47: Git Going With DVCS v1.3

Index vs. Hash‣ Centralized VCS uses DB auto-increment index.‣ Git uses SHA-1 hash.‣ Hash for the sake of integrity.

Hashable Objects‣ Blob‣ Tree‣ Commit‣ Tag

SHA-1 Hash

Page 48: Git Going With DVCS v1.3

Index vs. Hash‣ Centralized VCS uses DB auto-increment index.‣ Git uses SHA-1 hash.‣ Hash for the sake of integrity.

Hashable Objects‣ Blob‣ Tree‣ Commit‣ Tag

SHA-1 Hash

I thought

hashes were

for

passwords?

Page 49: Git Going With DVCS v1.3

http://book.git-scm.com/1_the_git_object_model.html

Page 50: Git Going With DVCS v1.3

http://book.git-scm.com/1_the_git_object_model.html

Page 51: Git Going With DVCS v1.3

http://book.git-scm.com/1_the_git_object_model.html

Page 52: Git Going With DVCS v1.3

http://book.git-scm.com/1_the_git_object_model.html

Page 53: Git Going With DVCS v1.3
Page 54: Git Going With DVCS v1.3

BobAliceCentralized

Page 55: Git Going With DVCS v1.3

BobAlice1 = okay.htm

Centralized

Page 56: Git Going With DVCS v1.3

BobAlice1 = okay.htm

2 = fine.htm

Centralized

Page 57: Git Going With DVCS v1.3

BobAlice1 = okay.htm

2 = fine.htm Sync

Centralized

Page 58: Git Going With DVCS v1.3

BobAlice1 = okay.htm

2 = fine.htm

1 = okay.htm

2 = fine.htm Sync

Centralized

Page 59: Git Going With DVCS v1.3

BobAlice1 = okay.htm

2 = fine.htm

3 = good.htm

1 = okay.htm

2 = fine.htm Sync

Centralized

Page 60: Git Going With DVCS v1.3

BobAlice1 = okay.htm

2 = fine.htm

3 = good.htm

1 = okay.htm

2 = fine.htm

3 = great.htm

Sync

Centralized

Page 61: Git Going With DVCS v1.3

BobAlice1 = okay.htm

2 = fine.htm

3 = good.htm

1 = okay.htm

2 = fine.htm

3 = great.htm

Sync

Sync

Centralized

Page 62: Git Going With DVCS v1.3

BobAlice1 = okay.htm

2 = fine.htm

3 = good.htm

1 = okay.htm

2 = fine.htm

3 = great.htm

4 = good.htm

4 = great.htm

Sync

Sync

Centralized

Page 63: Git Going With DVCS v1.3

BobAlice1 = okay.htm

2 = fine.htm

3 = good.htm

1 = okay.htm

2 = fine.htm

3 = great.htm

4 = good.htm

4 = great.htm

Sync

Sync

Centralized

ERRORERROR

Page 64: Git Going With DVCS v1.3
Page 65: Git Going With DVCS v1.3

BobAliceDistributed

Page 66: Git Going With DVCS v1.3

BobAlicea233b76 = okay.htm

Distributed

Page 67: Git Going With DVCS v1.3

BobAlicea233b76 = okay.htm

d234ab1 = fine.htm

Distributed

Page 68: Git Going With DVCS v1.3

BobAlicea233b76 = okay.htm

d234ab1 = fine.htm Sync

Distributed

Page 69: Git Going With DVCS v1.3

BobAlicea233b76 = okay.htm

d234ab1 = fine.htm

a233b76 = okay.htm

d234ab1 = fine.htm Sync

Distributed

Page 70: Git Going With DVCS v1.3

BobAlicea233b76 = okay.htm

d234ab1 = fine.htm

f90b12c = good.htm

a233b76 = okay.htm

d234ab1 = fine.htm Sync

Distributed

Page 71: Git Going With DVCS v1.3

BobAlicea233b76 = okay.htm

d234ab1 = fine.htm

f90b12c = good.htm

a233b76 = okay.htm

d234ab1 = fine.htm

ae42ba0 = great.htm

Sync

Distributed

Page 72: Git Going With DVCS v1.3

BobAlicea233b76 = okay.htm

d234ab1 = fine.htm

f90b12c = good.htm

a233b76 = okay.htm

d234ab1 = fine.htm

ae42ba0 = great.htm

Sync

Sync

Distributed

Page 73: Git Going With DVCS v1.3

BobAlicea233b76 = okay.htm

d234ab1 = fine.htm

f90b12c = good.htm

a233b76 = okay.htm

d234ab1 = fine.htm

ae42ba0 = great.htm ae42ba0 = great.htm

f90b12c = good.htm

Sync

Sync

Distributed

Page 74: Git Going With DVCS v1.3

Integrity‣ Identifies damaged repos.‣ Prevents modification of published history.‣ Unique to file size and contents.

Tags‣ Cryptographically sign tags by GPG/email.

Independence‣ Separation from sequence # of checkin.

Hash Benefits

Page 75: Git Going With DVCS v1.3

Location,Location,Location

Page 76: Git Going With DVCS v1.3

Subversion‣ svn commit‣ Adds everything modified.‣ Must list if you want specific files.‣ What if you check in your password?

Single Stage Thinking

Page 77: Git Going With DVCS v1.3

$ echo //password >> Matt1.java$ echo //password >> Matt2.java

Page 78: Git Going With DVCS v1.3

$ echo //password >> Matt1.java$ echo //password >> Matt2.java

$ svn statusM Matt1.javaM Matt2.java

Page 79: Git Going With DVCS v1.3

$ echo //password >> Matt1.java$ echo //password >> Matt2.java

$ svn statusM Matt1.javaM Matt2.java

$ svn commit -m'Matts checkin'Adding Matt1.javaAdding Matt2.javaTransmitting file data .Committed revision 2.

Page 80: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash Rem

ote

Page 81: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash Rem

ote

Page 82: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash

git clone

Rem

ote

Page 83: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash

git clone

git checkout

Rem

ote

Page 84: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash

git clone

git checkout

edit some files

Rem

ote

Page 85: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash

git clone

git checkout

edit some files

git stash

Rem

ote

Page 86: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash

git clone

git checkout

edit some files

git stash

edit some files

Rem

ote

Page 87: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash

git clone

git checkout

edit some files

git stash

edit some files

git stash apply

Rem

ote

Page 88: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash

git clone

git checkout

edit some files

git stash

edit some files

git stash apply

git add

Rem

ote

Page 89: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash

git clone

git checkout

edit some files

git stash

edit some files

git stash apply

git add

git commit

Rem

ote

Page 90: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash

git clone

git checkout

edit some files

git stash

edit some files

git stash apply

git add

git commit

Rem

ote

git push

Page 91: Git Going With DVCS v1.3

Repo

is like a special

IndexWorking

Stash

git clone

git checkout

edit some files

git stash

edit some files

git stash apply

git add

git commit

Rem

ote

git push

Page 92: Git Going With DVCS v1.3

git clone git://somedomain/myproj.gitcd myproj.git

◀Build repo

Page 93: Git Going With DVCS v1.3

git clone git://somedomain/myproj.gitcd myproj.git

git checkout master

◀Build repo

◀Update index

Page 94: Git Going With DVCS v1.3

git clone git://somedomain/myproj.gitcd myproj.git

git checkout master

echo ‘//Comments’ >> ClassOne.javaecho ‘//Thoughts’ >> ClassTwo.java

◀Build repo

◀Update index

◀Edit working

Page 95: Git Going With DVCS v1.3

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’

◀Build repo

◀Update index

◀Edit working

◀Add to index

◀Save to repo

Page 96: Git Going With DVCS v1.3

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 97: Git Going With DVCS v1.3

Git‣ git add‣ git commit‣ git push‣ Commits only what is added to the index.‣ Opportunity to change history locally.‣ Selectively share with other repos.

Three Stage Thinking

Page 98: Git Going With DVCS v1.3

$ echo //SECRETPASSWORD >> mattfile1.txt$ echo //NewText2 >> mattfile2.txt

Page 99: Git Going With DVCS v1.3

$ echo //SECRETPASSWORD >> mattfile1.txt$ echo //NewText2 >> mattfile2.txt

$ git status# On branch master# Changed but not updated:# modified: mattfile1.txt# modified: mattfile2.txt

Page 100: Git Going With DVCS v1.3

$ echo //SECRETPASSWORD >> mattfile1.txt$ echo //NewText2 >> mattfile2.txt

$ git status# On branch master# Changed but not updated:# modified: mattfile1.txt# modified: mattfile2.txt

$ git add mattfile1.txt ◀Put into index

Page 101: Git Going With DVCS v1.3

$ echo //SECRETPASSWORD >> mattfile1.txt$ echo //NewText2 >> mattfile2.txt

$ git status# On branch master# Changed but not updated:# modified: mattfile1.txt# modified: mattfile2.txt

$ git add mattfile1.txt

$ git commit -m'Matts pw checkin'[master]: created ddcdf18: "Matts changes" 1 files changed, 1 insertions(+), 0 deletions(-)

◀Put into index

◀Save to repo

Page 102: Git Going With DVCS v1.3

#$%^&!I just committed my password!

Page 103: Git Going With DVCS v1.3

$ git reset --hard HEAD^HEAD is now at 9de4cd3 First checkin

$ git logcommit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993Author: Matthew McCullough <[email protected]>Date: Wed Mar 4 23:09:17 2009 -0700 First checkin

Change History

Page 104: Git Going With DVCS v1.3

$ git reset --hard HEAD^HEAD is now at 9de4cd3 First checkin

$ git logcommit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993Author: Matthew McCullough <[email protected]>Date: Wed Mar 4 23:09:17 2009 -0700 First checkin

Change History

◀Throw away the commit

Page 105: Git Going With DVCS v1.3

$ git reset --hard HEAD^HEAD is now at 9de4cd3 First checkin

$ git logcommit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993Author: Matthew McCullough <[email protected]>Date: Wed Mar 4 23:09:17 2009 -0700 First checkin

Change History

◀Throw away the commit

Page 106: Git Going With DVCS v1.3

GitMathematics

Page 107: Git Going With DVCS v1.3

a32

2e2

8b3

4e8

Directed Acyclic Graph

Page 108: Git Going With DVCS v1.3

a32

2e2

5fa

8b3

4e8

Ann’s Feature

Directed Acyclic Graph

Page 109: Git Going With DVCS v1.3

a32

2e2

5fa

8b3

4e8

Ann’s Feature

Directed Acyclic Graph

Page 110: Git Going With DVCS v1.3

a32

2e2

5fa

8b3

4e8

Ann’s Feature

Tim’s Feature

Directed Acyclic Graph

d19

Page 111: Git Going With DVCS v1.3

a32

2e2

5fa

8b3

4e8

e69

Ann’s Feature

Tim’s Feature

Directed Acyclic Graph

Linus’ rewrite of Tim’s feature

d19

Page 112: Git Going With DVCS v1.3

a32

2e2

5fa

8b3

4e8

e69

Ann’s Feature

Tim’s Feature

Directed Acyclic Graph

Linus’ rewrite of Tim’s feature

d19

Page 113: Git Going With DVCS v1.3

Sharing

Page 114: Git Going With DVCS v1.3

Network‣ 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 115: Git Going With DVCS v1.3
Page 116: Git Going With DVCS v1.3
Page 117: Git Going With DVCS v1.3

Filesystem‣ Local folders. Yes, they can be “remotes.”

‣ Mapped network drives. Just like folders.

Serving It Up

Page 118: Git Going With DVCS v1.3

git clone git://somehost.org/myproj.git ◀git daemon

Page 119: Git Going With DVCS v1.3

git clone git://somehost.org/myproj.git

git clone [email protected]:myproj.git

◀git daemon

◀SSH

Page 120: Git Going With DVCS v1.3

git clone git://somehost.org/myproj.git

git clone [email protected]:myproj.git

git clone http://somehost.org/myproj.git

◀git daemon

◀SSH

◀HTTP

Page 121: Git Going With DVCS v1.3

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 daemon

◀SSH

◀HTTP

◀Filesystem

Page 122: Git Going With DVCS v1.3

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 123: Git Going With DVCS v1.3

Merge & Rebase

Page 124: Git Going With DVCS v1.3

Cheap Branches

Page 125: Git Going With DVCS v1.3

git show-branch --allgit branch -a

‣Local branch‣localbranchname‣Remote‣remote/branchname

Cheap Branches

Page 126: Git Going With DVCS v1.3

Merge Anything

Page 127: Git Going With DVCS v1.3

git merge --no-commit <sourcebranch>git merge --squash <sourcebranch>git merge <sourcebranch1> <sourcebranch2>

‣Selectable merge strategy‣Octopus: More than one ‣Review before committing‣Flatten micro-checkins

Merge Anything

Page 128: Git Going With DVCS v1.3

Merge Strategies

Page 129: Git Going With DVCS v1.3

Rebase for Clarity

Page 130: Git Going With DVCS v1.3

git checkout myfeaturebranchgit rebase master

‣Cleaner history than a merge‣Fast forwards original branch‣Lets you see “how trunk will act” before you merge

Rebase for Clarity

Page 131: Git Going With DVCS v1.3

WorkingOffline

Page 132: Git Going With DVCS v1.3

Checkin

Offline Anything

Page 133: Git Going With DVCS v1.3

CheckinAddBranchList change logGrep historyRewrite historyStashMergeLabelRemove

Offline Anything

Page 134: Git Going With DVCS v1.3

CheckinAddBranchList change logGrep historyRewrite historyStashMergeLabelRemovepractically everything but push

Offline Anything

Page 135: Git Going With DVCS v1.3

CheckinAddBranchList change logGrep historyRewrite historyStashMergeLabelRemovepractically everything but push

Offline Anything

Page 136: Git Going With DVCS v1.3
Page 137: Git Going With DVCS v1.3

Hooray! Another checkin to my latest OSS

project!

Page 138: Git Going With DVCS v1.3

Hooray! Another checkin to my latest OSS

project!

I think I liked subversion better...

Page 139: Git Going With DVCS v1.3

Speed

Page 140: Git Going With DVCS v1.3

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 141: Git Going With DVCS v1.3

VCS Interop

Page 142: Git Going With DVCS v1.3

git svn clone http://unfurl.com/trunkgit svn dcommit

‣ First class compatibility.

‣ Round trip support.

‣ Git commits = svn commits.

Subversion

Page 143: Git Going With DVCS v1.3
Page 144: Git Going With DVCS v1.3

UsageModels

Page 145: Git Going With DVCS v1.3

Central Repo

Ce

nt

ra

liz

ed

Page 146: Git Going With DVCS v1.3

Central Repo

Ce

nt

ra

liz

ed

Page 147: Git Going With DVCS v1.3

Blessed Repo

Dic

ta

to

rs

hip

Page 148: Git Going With DVCS v1.3

Blessed Repo

Dic

ta

to

rs

hip

Page 149: Git Going With DVCS v1.3

Blessed Repo

Dic

ta

to

rs

hip

Page 150: Git Going With DVCS v1.3

Blessed Repo

Dic

ta

to

rs

hip

Page 151: Git Going With DVCS v1.3

Blessed Repo

Dic

ta

to

rs

hip

Page 152: Git Going With DVCS v1.3

Certified Repo

Development Repo

Int

eg

ra

tio

n M

an

ag

ed

Page 153: Git Going With DVCS v1.3

Certified Repo

Development Repo

Int

eg

ra

tio

n M

an

ag

ed

Page 154: Git Going With DVCS v1.3

Certified Repo

Development Repo

Int

eg

ra

tio

n M

an

ag

ed

Page 155: Git Going With DVCS v1.3

Certified Repo

Development Repo

Int

eg

ra

tio

n M

an

ag

ed

Page 156: Git Going With DVCS v1.3

Mirror

Development Repo

Mir

ro

re

d

Mirror

Certified Repo

Page 157: Git Going With DVCS v1.3

Mirror

Development Repo

Mir

ro

re

d

Mirror

Certified Repo

Page 158: Git Going With DVCS v1.3

Mirror

Development Repo

Mir

ro

re

d

Mirror

Certified Repo

Page 159: Git Going With DVCS v1.3

Mirror

Development Repo

Mir

ro

re

d

Mirror

Certified Repo

Page 160: Git Going With DVCS v1.3

Mirror

Development Repo

Mir

ro

re

d

Mirror

Certified Repo

Page 161: Git Going With DVCS v1.3

Cu

st

om

+ P

ub

lic

Co

nt

rib

☚ P

riva

te

Pub

lic ☛

GitHub

Page 162: Git Going With DVCS v1.3

Cu

st

om

+ P

ub

lic

Co

nt

rib

☚ P

riva

te

Pub

lic ☛

GitHub

Page 163: Git Going With DVCS v1.3

Cu

st

om

+ P

ub

lic

Co

nt

rib

Customized

☚ P

riva

te

Pub

lic ☛

GitHub

Page 164: Git Going With DVCS v1.3

Cu

st

om

+ P

ub

lic

Co

nt

rib

Customized

☚ P

riva

te

Pub

lic ☛

GitHub

Page 165: Git Going With DVCS v1.3

Cu

st

om

+ P

ub

lic

Co

nt

rib

Customized

☚ P

riva

te

Pub

lic ☛

GitHub

Page 166: Git Going With DVCS v1.3

GUIs

Page 167: Git Going With DVCS v1.3

GitX

Page 168: Git Going With DVCS v1.3

gitSafe

Page 169: Git Going With DVCS v1.3

GitK

Page 170: Git Going With DVCS v1.3

GitGUI

Page 171: Git Going With DVCS v1.3
Page 172: Git Going With DVCS v1.3

reasons6

Page 173: Git Going With DVCS v1.3

❻‣git cherry-pick a5b2ee

Cherry Pick

Page 174: Git Going With DVCS v1.3

❻‣git cherry-pick a5b2ee

‣Merge in just one commit.

Cherry Pick

Page 175: Git Going With DVCS v1.3

❻‣git cherry-pick a5b2ee

‣Merge in just one commit.

‣When you want a nugget, not a branchload.

Cherry Pick

Page 176: Git Going With DVCS v1.3

❺‣Tracks who authors a change.

Gives Credit

Page 177: Git Going With DVCS v1.3

❺‣Tracks who authors a change.

‣“Author” even survives passing through reviewers.

Gives Credit

Page 178: Git Going With DVCS v1.3

❺‣Tracks who authors a change.

‣“Author” even survives passing through reviewers.

‣“Author” survives all merges.

Gives Credit

Page 179: Git Going With DVCS v1.3

❺‣Tracks who authors a change.

‣“Author” even survives passing through reviewers.

‣“Author” survives all merges.

‣Additionally tracks who committed a change.

Gives Credit

Page 180: Git Going With DVCS v1.3

❹‣git bisect run mvn test

Bisect Bugs

Page 181: Git Going With DVCS v1.3

❹‣git bisect run mvn test

‣Binary-search for bug.

Bisect Bugs

Page 182: Git Going With DVCS v1.3

❹‣git bisect run mvn test

‣Binary-search for bug.

‣Manual or automated modes.

Bisect Bugs

Page 183: Git Going With DVCS v1.3

❹‣git bisect run mvn test

‣Binary-search for bug.

‣Manual or automated modes.

‣Yak cruelty-prevention.

Bisect Bugs

Page 184: Git Going With DVCS v1.3

❸‣git merge --squash mybranch

Squash Verbosity

Page 185: Git Going With DVCS v1.3

❸‣git merge --squash mybranch

‣Reduce all your micro-checkins to block commits.

Squash Verbosity

Page 186: Git Going With DVCS v1.3

❸‣git merge --squash mybranch

‣Reduce all your micro-checkins to block commits.

‣Make mistakes, revise, checkin without hesitation.

Squash Verbosity

Page 187: Git Going With DVCS v1.3

❸‣git merge --squash mybranch

‣Reduce all your micro-checkins to block commits.

‣Make mistakes, revise, checkin without hesitation.

‣Great for SVN compatibility.

Squash Verbosity

Page 188: Git Going With DVCS v1.3

❷‣git grep SomeText HEAD^^^

Search History

Page 189: Git Going With DVCS v1.3

❷‣git grep SomeText HEAD^^^

‣Search in file history without checkout.

Search History

Page 190: Git Going With DVCS v1.3

❷‣git grep SomeText HEAD^^^

‣Search in file history without checkout.

‣Greps contents.

Search History

Page 191: Git Going With DVCS v1.3

❶‣git rebase master

Rebase

Page 192: Git Going With DVCS v1.3

❶‣git rebase master

‣Reposition your feature branch’s start point.

Rebase

Page 193: Git Going With DVCS v1.3

❶‣git rebase master

‣Reposition your feature branch’s start point.

‣Makes for simpler merge graphs.

Rebase

Page 194: Git Going With DVCS v1.3

❶‣git rebase master

‣Reposition your feature branch’s start point.

‣Makes for simpler merge graphs.

‣Sustains feature-branch work clarity.

Rebase

Page 195: Git Going With DVCS v1.3
Page 196: Git Going With DVCS v1.3

Tomorrow’s VCS, Today

Page 197: Git Going With DVCS v1.3

MatthewTwitter @matthewmccull

Blog http://www.ambientideas.com/blog sidebar has all my social media links

Email [email protected]

GitHub http://github.com/matthewmccullough

Page 198: Git Going With DVCS v1.3

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 199: Git Going With DVCS v1.3

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 200: Git Going With DVCS v1.3

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 201: Git Going With DVCS v1.3

‣ 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