454
Git 101 Scott Chacon

Git 101 Presentation

Embed Size (px)

DESCRIPTION

The slides for my talk at Symfony Live conference in Paris

Citation preview

Page 1: Git 101 Presentation

Git 101Scott Chacon

Page 2: Git 101 Presentation

Introduction

Page 3: Git 101 Presentation

Me

Page 4: Git 101 Presentation

Scott Chacon

Page 5: Git 101 Presentation
Page 6: Git 101 Presentation

git-scm.com

Page 7: Git 101 Presentation
Page 8: Git 101 Presentation

http://progit.org

Page 10: Git 101 Presentation

@chacontwitter

Page 11: Git 101 Presentation

</me>

Page 12: Git 101 Presentation

What is Git?

Page 13: Git 101 Presentation

Git is an open source, distributed version control system designed for speed

and efficiency

Page 14: Git 101 Presentation

version control

Page 15: Git 101 Presentation

version control

subversion (svn)

mercurial (hg)

visual source safe

bazaar

concurrent version system (cvs)

perforce

Page 16: Git 101 Presentation

version control

subversion (svn)

mercurial (hg)

visual source safe

bazaar

concurrent version system (cvs)

perforce

SoS

Page 17: Git 101 Presentation

version control

subversion (svn)

mercurial (hg)

visual source safe

bazaar

concurrent version system (cvs)

perforce

SoS“not bad”

Page 18: Git 101 Presentation

version control

subversion (svn)

mercurial (hg)

visual source safe

bazaar

concurrent version system (cvs)

perforce

SoS

“kill self”

Page 19: Git 101 Presentation

version control

subversion (svn)

mercurial (hg)

visual source safe

bazaar

concurrent version system (cvs)

perforce

git

Page 20: Git 101 Presentation

Git is an open source, distributed version control system designed for speed

and efficiency

Page 21: Git 101 Presentation

git-scm.com

Page 22: Git 101 Presentation

Git is an open source, distributed version control

system designed for speed and efficiency

Page 23: Git 101 Presentation

Fully Distributed

Page 24: Git 101 Presentation

(almost) everything is local

Page 25: Git 101 Presentation

which means

everything is fast

every clone is a backup

work offline

Page 26: Git 101 Presentation

No Network Needed

Performing a diff

Viewing file history

Committing changes

Merging branches

Obtaining other revisions of a file

Switching branches

Page 27: Git 101 Presentation

Git is an open source, distributed version control

system designed for speed and efficiency

Page 28: Git 101 Presentation
Page 29: Git 101 Presentation

Immutable

Page 30: Git 101 Presentation

(almost) never removes data

Page 31: Git 101 Presentation

Snapshots, not Patches

Page 32: Git 101 Presentation

deltastorage

snapshotstorage

Page 33: Git 101 Presentation

deltastorage

snapshotstorage

Page 34: Git 101 Presentation

deltastorage

snapshotstorage

Page 35: Git 101 Presentation

deltastorage

snapshotstorage

Page 36: Git 101 Presentation

deltastorage

snapshotstorage

Page 37: Git 101 Presentation

deltastorage

snapshotstorage

Page 38: Git 101 Presentation

deltastorage

snapshotstorage

Page 39: Git 101 Presentation

deltastorage

snapshotstorage

Page 40: Git 101 Presentation

deltastorage

snapshotstorage

Page 41: Git 101 Presentation

deltastorage

snapshotstorage

Page 42: Git 101 Presentation

deltastorage

snapshotstorage

Page 43: Git 101 Presentation

deltastorage

snapshotstorage

Page 44: Git 101 Presentation

deltastorage

snapshotstorage

Page 45: Git 101 Presentation

deltastorage

snapshotstorage

Page 46: Git 101 Presentation

deltastorage

snapshotstorage

Page 47: Git 101 Presentation

Basic Git

Page 48: Git 101 Presentation

First Steps

Page 49: Git 101 Presentation

$ git config --global user.name “Scott Chacon”

$ git config --global user.email “[email protected]

Page 50: Git 101 Presentation

Getting a Repo

Page 51: Git 101 Presentation

Create One

Page 52: Git 101 Presentation

git init

Page 53: Git 101 Presentation

$ touch hello_world.rb$ git init$ git add .$ git commit -m ‘first commit’

Page 54: Git 101 Presentation

$ touch hello_world.rb$ git init$ git add .$ git commit -m ‘first commit’

Page 55: Git 101 Presentation

$ tree -a.|-- .git| |-- HEAD| |-- branches| |-- config| |-- description| |-- hooks| | |-- post-commit.sample| | |-- post-receive.sample| | |-- ...| | |-- pre-rebase.sample| | `-- update.sample| |-- info| | `-- exclude| |-- objects| | |-- info| | `-- pack| |-- refs| | |-- heads| | `-- tags| `-- remotes`-- hello_world.rb

11 directories, 25 files

Page 56: Git 101 Presentation

$ tree -a.|-- .git| |-- HEAD| |-- branches| |-- config| |-- description| |-- hooks| | |-- post-commit.sample| | |-- post-receive.sample| | |-- ...| | |-- pre-rebase.sample| | `-- update.sample| |-- info| | `-- exclude| |-- objects| | |-- info| | `-- pack| |-- refs| | |-- heads| | `-- tags| `-- remotes`-- hello_world.rb

11 directories, 25 files

Page 57: Git 101 Presentation

$ tree -a.|-- .git| |-- HEAD| |-- branches| |-- config| |-- description| |-- hooks| | |-- post-commit.sample| | |-- post-receive.sample| | |-- ...| | |-- pre-rebase.sample| | `-- update.sample| |-- info| | `-- exclude| |-- objects| | |-- info| | `-- pack| |-- refs| | |-- heads| | `-- tags| `-- remotes`-- hello_world.rb

11 directories, 25 files

Page 58: Git 101 Presentation

$ touch hello_world.rb$ git init$ git add .$ git commit -m ‘first commit’

Page 59: Git 101 Presentation

$ touch hello_world.rb$ git init$ git add .$ git commit -m ‘first commit’

Page 60: Git 101 Presentation

$ tree -a.|-- .git| |-- COMMIT_EDITMSG| |-- HEAD| |-- branches| |-- config| |-- description| |-- hooks| | |-- applypatch-msg.sample| | `-- update.sample| |-- index| |-- info| | `-- exclude| |-- logs| | |-- HEAD| | `-- refs| | `-- heads| | `-- master| |-- objects| | |-- 32/09658ac8d80bc9726d3a33d77e3dfc5fe6035e| | |-- 53/9cd7886a627841d525a78d45cbc6396be20b41| | |-- e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391| | |-- info| | `-- pack| |-- refs| | |-- heads| | | `-- master| | `-- tags| `-- remotes`-- hello_world.rb

17 directories, 33 files

Page 61: Git 101 Presentation

$ tree -a.|-- .git| |-- COMMIT_EDITMSG| |-- HEAD| |-- branches| |-- config| |-- description| |-- hooks| | |-- applypatch-msg.sample| | `-- update.sample| |-- index| |-- info| | `-- exclude| |-- logs| | |-- HEAD| | `-- refs| | `-- heads| | `-- master| |-- objects| | |-- 32/09658ac8d80bc9726d3a33d77e3dfc5fe6035e| | |-- 53/9cd7886a627841d525a78d45cbc6396be20b41| | |-- e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391| | |-- info| | `-- pack| |-- refs| | |-- heads| | | `-- master| | `-- tags| `-- remotes`-- hello_world.rb

17 directories, 33 files

Page 62: Git 101 Presentation

$ tree -a.|-- .git| |-- COMMIT_EDITMSG| |-- HEAD| |-- branches| |-- config| |-- description| |-- hooks| | |-- applypatch-msg.sample| | `-- update.sample| |-- index| |-- info| | `-- exclude| |-- logs| | |-- HEAD| | `-- refs| | `-- heads| | `-- master| |-- objects| | |-- 32/09658ac8d80bc9726d3a33d77e3dfc5fe6035e| | |-- 53/9cd7886a627841d525a78d45cbc6396be20b41| | |-- e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391| | |-- info| | `-- pack| |-- refs| | |-- heads| | | `-- master| | `-- tags| `-- remotes`-- hello_world.rb

17 directories, 33 files

Page 63: Git 101 Presentation

Clone One

Page 64: Git 101 Presentation

git clone

Page 65: Git 101 Presentation

$ git clone git://github.com/schacon/ticgit.gitInitialized empty Git repository in /private/tmp/ticgit/.git/remote: Counting objects: 591, done.remote: Compressing objects: 100% (267/267), done.remote: Total 591 (delta 253), reused 587 (delta 252)Receiving objects: 100% (591/591), 73.05 KiB, done.Resolving deltas: 100% (253/253), done.$ cd ticgit/$ lsLICENSE! ! Rakefile! examples! note! ! ticgit.gemspecREADME!! bin!! lib!! spec$

Page 66: Git 101 Presentation

$ git clone git://github.com/schacon/ticgit.gitInitialized empty Git repository in /private/tmp/ticgit/.git/remote: Counting objects: 591, done.remote: Compressing objects: 100% (267/267), done.remote: Total 591 (delta 253), reused 587 (delta 252)Receiving objects: 100% (591/591), 73.05 KiB, done.Resolving deltas: 100% (253/253), done.$ cd ticgit/$ lsLICENSE! ! Rakefile! examples! note! ! ticgit.gemspecREADME!! bin!! lib!! spec$

Page 67: Git 101 Presentation

$ git clone git://github.com/schacon/ticgit.gitInitialized empty Git repository in /private/tmp/ticgit/.git/remote: Counting objects: 591, done.remote: Compressing objects: 100% (267/267), done.remote: Total 591 (delta 253), reused 587 (delta 252)Receiving objects: 100% (591/591), 73.05 KiB, done.Resolving deltas: 100% (253/253), done.$ cd ticgit/$ lsLICENSE! ! Rakefile! examples! note! ! ticgit.gemspecREADME!! bin!! lib!! spec$

Page 68: Git 101 Presentation

$ git clone git://github.com/schacon/ticgit.gitInitialized empty Git repository in /private/tmp/ticgit/.git/remote: Counting objects: 591, done.remote: Compressing objects: 100% (267/267), done.remote: Total 591 (delta 253), reused 587 (delta 252)Receiving objects: 100% (591/591), 73.05 KiB, done.Resolving deltas: 100% (253/253), done.$ cd ticgit/$ ls.git LICENSE! ! Rakefile! examples! note! !ticgit.gemspec README!! bin!! lib!! spec$

Page 69: Git 101 Presentation

A Basic Workflow

Page 70: Git 101 Presentation

A Basic Workflow

Edit files

Stage the changes

Review your changes

Commit the changes

Page 71: Git 101 Presentation

working directory

repository

index

git add

git commit

Page 72: Git 101 Presentation

working directory

repository

index

git add

git commit

a working copy of your project

Page 73: Git 101 Presentation

working directory

repository

index

git add

git commit

object database

Page 74: Git 101 Presentation

working directory

repository

index

git add

git commit

“staging”

Page 75: Git 101 Presentation

A Basic Workflow

Edit files

Stage the changes

Review your changes

Commit the changes

Page 76: Git 101 Presentation

$ find ../app.yaml./index.yaml./main.py

Page 77: Git 101 Presentation

#!/usr/bin/env pythonimport wsgiref.handlersfrom google.appengine.ext import webapp

class MainHandler(webapp.RequestHandler):

def get(self): self.response.out.write('Hello world!')

def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__': main()~ ~ "main.py" 16L, 402C

$ vim main.py

Page 78: Git 101 Presentation

#!/usr/bin/env pythonimport wsgiref.handlersfrom google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

def get(self): self.response.out.write('Hello world!')

def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__': main()~ ~ "main.py" 16L, 402C

$ vim main.py

Page 79: Git 101 Presentation

$ git status

Page 80: Git 101 Presentation

$ git status# On branch master# Changed but not updated:# (use "git add <file>..." to update what will be committed)##modified: main.py#no changes added to commit (use "git add" and/or "git commit -a")

Page 81: Git 101 Presentation

$ git status# On branch master# Changed but not updated:# (use "git add <file>..." to update what will be committed)##modified: main.py#no changes added to commit (use "git add" and/or "git commit -a")

Page 82: Git 101 Presentation

$ git status# On branch master# Changed but not updated:# (use "git add <file>..." to update what will be committed)##modified: main.py#no changes added to commit (use "git add" and/or "git commit -a")

Page 83: Git 101 Presentation

$ git status# On branch master# Changed but not updated:# (use "git add <file>..." to update what will be committed)##modified: main.py#no changes added to commit (use "git add" and/or "git commit -a")

STAGED

Page 84: Git 101 Presentation

A Basic Workflow

Edit files

Stage the changes

Review your changes

Commit the changes

Page 85: Git 101 Presentation

git add

Page 86: Git 101 Presentation

working directory

repository

index

git add

git commit

Page 87: Git 101 Presentation

working directory

repository

index

git add

git commit

Page 88: Git 101 Presentation

$ git add main.py$ git status# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)##modified: main.py#

Page 89: Git 101 Presentation

# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)##modified: main.py#

$ git add main.py$ git status

Page 90: Git 101 Presentation

# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)##modified: main.py#

$ git add main.py$ git status

THAT ARE STAGED

Page 91: Git 101 Presentation

$ vim app.yamlapplication: chaconversion: 1runtime: pythonapi_version: 1

handlers:- url: .* script: main.py~ ~ ~ "app.yaml" 8L, 101C

Page 92: Git 101 Presentation

application: chaconversion: 1runtime: pythonapi_version: 1

handlers:- url: .* script: main.py~ ~ ~ "app.yaml" 8L, 101C

$ vim app.yaml

Page 93: Git 101 Presentation

application: chaconversion: 2runtime: pythonapi_version: 1

handlers:- url: .* script: main.py~ ~ ~ "app.yaml" 8L, 101C

$ vim app.yaml

Page 94: Git 101 Presentation

$ git status# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: main.py## Changed but not updated:# (use "git add <file>..." to update what will be committed)## modified: app.yaml#

Page 95: Git 101 Presentation

$ vim main.py#!/usr/bin/env pythonimport wsgiref.handlersfrom google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

def get(self): self.response.out.write('Hello world!')

def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__': main()~ ~ "main.py" 16L, 402C

Page 96: Git 101 Presentation

#!/usr/bin/env pythonimport wsgiref.handlersfrom google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

def get(self): self.response.out.write('Hola world!')

def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__': main()~ ~ "main.py" 16L, 402C

$ vim main.py

Page 97: Git 101 Presentation

#!/usr/bin/env pythonimport wsgiref.handlersfrom google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

def get(self): self.response.out.write('Hola Mundo!')

def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__': main()~ ~ "main.py" 16L, 402C

$ vim main.py

Page 98: Git 101 Presentation

# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: main.py## Changed but not updated:# (use "git add <file>..." to update what will be committed)## modified: app.yaml# modified: main.py#

$ git status

Page 99: Git 101 Presentation

# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: main.py## Changed but not updated:# (use "git add <file>..." to update what will be committed)## modified: app.yaml# modified: main.py#

$ git status

Staged

Page 100: Git 101 Presentation

# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: main.py## Changed but not updated:# (use "git add <file>..." to update what will be committed)## modified: app.yaml# modified: main.py#

$ git status

Unstaged

Page 101: Git 101 Presentation

# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: main.py## Changed but not updated:# (use "git add <file>..." to update what will be committed)## modified: app.yaml# modified: main.py#

$ git status

Page 102: Git 101 Presentation

#!/usr/bin/env pythonimport wsgiref.handlersfrom google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

def get(self): self.response.out.write('Hola Mundo!')

def main(): application = webapp.WSGIApplication([('/' debug=True) wsgiref.handlers.CGIHandler().run(applicat

if __name__ == '__main__': main()

#!/usr/bin/env pythonimport wsgiref.handlersfrom google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

def get(self): self.response.out.write('Hello World!')

def main(): application = webapp.WSGIApplication([('/' debug=True) wsgiref.handlers.CGIHandler().run(applicat

if __name__ == '__main__': main()

Staged In Working Directory

Page 103: Git 101 Presentation

#!/usr/bin/env pythonimport wsgiref.handlersfrom google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

def get(self): self.response.out.write('Hola Mundo!')

def main(): application = webapp.WSGIApplication([('/' debug=True) wsgiref.handlers.CGIHandler().run(applicat

if __name__ == '__main__': main()

#!/usr/bin/env pythonimport wsgiref.handlersfrom google.appengine.ext import webapp

# this program prints out ‘hello world’

class MainHandler(webapp.RequestHandler):

def get(self): self.response.out.write('Hello World!')

def main(): application = webapp.WSGIApplication([('/' debug=True) wsgiref.handlers.CGIHandler().run(applicat

if __name__ == '__main__': main()

Staged In Working Directory

Page 104: Git 101 Presentation

You have to stage a file after you edit it

Page 105: Git 101 Presentation

You have to stage a file after you edit it

Page 106: Git 101 Presentation

You have to stage a file after you edit it

Page 107: Git 101 Presentation

$ git status# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: app.yaml# modified: main.py#

$ git add app.yaml main.py

Page 108: Git 101 Presentation

A Basic Workflow

Edit files

Stage the changes

Review your changes

Commit the changes

Page 109: Git 101 Presentation

git commit

Page 110: Git 101 Presentation

working directory

repository

index

git add

git commit

Page 111: Git 101 Presentation

working directory

repository

index

git add

git commit

Page 112: Git 101 Presentation

$ git commit

# Please enter the commit message for your changes. Lines starting# with '#' will be ignored, and an empty message aborts the commit.# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: app.yaml# modified: main.py#~ ~ ~ ~ ".git/COMMIT_EDITMSG" 10L, 279C

Page 113: Git 101 Presentation

descriptive commit message# Please enter the commit message for your changes. Lines starting# with '#' will be ignored, and an empty message aborts the commit.# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: app.yaml# modified: main.py#~ ~ ~ ~ ".git/COMMIT_EDITMSG" 10L, 279C

$ git commit

Page 114: Git 101 Presentation

descriptive commit message# Please enter the commit message for your changes. Lines starting# with '#' will be ignored, and an empty message aborts the commit.# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: app.yaml# modified: main.py#~ ~ ~ ~ ".git/COMMIT_EDITMSG" 10L, 279C

$ git commit

Page 115: Git 101 Presentation

$ git commitCreated commit 77d3001: descriptive commit message 2 files changed, 4 insertions(+), 2 deletions(-)

Page 116: Git 101 Presentation

A Basic Workflow

Edit files

Stage the changes

Review your changes

Commit the changes

vim / emacs / etc

git add (file)

repo status

git commit

Page 117: Git 101 Presentation

A Basic Workflow

Edit files

Stage the changes

Review your changes

Commit the changes

vim / emacs / etc

git add (file)

repo status

git commit

Page 118: Git 101 Presentation

A Basic Workflow

Edit files

Stage the changes

Review your changes

Commit the changes

vim / emacs / etc

git add (file)

repo status

git commit

Page 119: Git 101 Presentation

A Basic Workflow

Edit files

Stage the changes

Review your changes

Commit the changes

vim / emacs / etc

git add (file)

git status

git commit

Page 120: Git 101 Presentation

A Basic Workflow

Edit files

Stage the changes

Review your changes

Commit the changes

vim / emacs / etc

git add (file)

git status

git commit

Page 121: Git 101 Presentation

A Basicer Workflow

Edit files

Stage and Commit

vim / emacs / etc

git commit -a

Page 122: Git 101 Presentation

What’s going on here?

Page 123: Git 101 Presentation

$ git commitCreated commit 77d3001: descriptive commit message 2 files changed, 4 insertions(+), 2 deletions(-)

Page 124: Git 101 Presentation

$ git commitCreated commit 77d3001: descriptive commit message 2 files changed, 4 insertions(+), 2 deletions(-)

Page 125: Git 101 Presentation

77d3001

Page 126: Git 101 Presentation

77d3001a1de6bf8f5e431972fe4d25b01e595c0b

Page 127: Git 101 Presentation

77d3001a1de6bf8f5e431972fe4d25b01e595c0b

Page 128: Git 101 Presentation

77d3001a1de6bf8f5e431972fe4d25b01e595c0b

commit size

ae668..

tree

parent

author

committermy commit message goes hereand it is really, really cool

c4ec5

a149e

Scott

Scott

Page 129: Git 101 Presentation

77d3001a1de6bf8f5e431972fe4d25b01e595c0b

commit size

ae668..

tree

parent

author

committermy commit message goes hereand it is really, really cool

c4ec5

a149e

Scott

Scott

tree c4ec543b0322744e55c5efc9b6c4e449d398dbffparent a149e2160b3f7573768cdc2fce24d0881f3577e1author Scott Chacon <[email protected]> 1223402504 -0700committer Scott Chacon <[email protected]> 1223402504 -0700

descriptive commit message

Page 130: Git 101 Presentation

77d3001a1de6bf8f5e431972fe4d25b01e595c0b

commit size

ae668..

tree

parent

author

committermy commit message goes hereand it is really, really cool

c4ec5

a149e

Scott

Scott

Page 131: Git 101 Presentation

77d3001a1de6bf8f5e431972fe4d25b01e595c0b

commit size

ae668..

tree

parent

author

committermy commit message goes hereand it is really, really cool

c4ec5

a149e

Scott

Scott

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

Page 132: Git 101 Presentation

commit size

ae668..

tree

parent

author

committermy commit message goes hereand it is really, really cool

c4ec5

a149e

Scott

Scott

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

commit size

tree

parent

author

committerthis is the previous commitand I am very proud of it

2de54

38def

Scott

Scott

Page 133: Git 101 Presentation

commit size

ae668..

tree

parent

author

committermy commit message goes hereand it is really, really cool

c4ec5

a149e

Scott

Scott

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

commit size

tree

parent

author

committerthis is the previous commitand I am very proud of it

2de54

38def

Scott

Scott

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

Page 134: Git 101 Presentation

commit size

ae668..

tree

parent

author

committermy commit message goes hereand it is really, really cool

c4ec5

a149e

Scott

Scott

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

commit size

tree

parent

author

committerthis is the previous commitand I am very proud of it

2de54

38def

Scott

Scott

commit size

tree

parent

author

committerthis is the commit before thatand I'm not sure why

2fe65

90ecd

Scott

Scott

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

commit size

tree

parent

author

committerthis is the commit before thatand I'm not sure why

2fe65

90ecd

Scott

Scott

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

Page 135: Git 101 Presentation

commit size

ae668..

tree

parent

author

committermy commit message goes hereand it is really, really cool

c4ec5

a149e

Scott

Scott

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

commit size

tree

parent

author

committerthis is the previous commitand I am very proud of it

2de54

38def

Scott

Scott

commit size

tree

parent

author

committerthis is the commit before thatand I'm not sure why

2fe65

90ecd

Scott

Scott

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

commit size

tree

parent

author

committerthis is the commit before thatand I'm not sure why

2fe65

90ecd

Scott

Scott

app.yaml

index.yaml

main.py

./ c4e

03e

1d3

3d5

48e 77da1438d

c4e

3d5

1d3

03e

f46

23f

30e

67e

32a

5b1

Page 136: Git 101 Presentation

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

Page 137: Git 101 Presentation

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

git checkout ae635

Page 138: Git 101 Presentation

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

git checkout ae635

Page 139: Git 101 Presentation

Working DirectoryIndex

Rakefile

README

simplegit.rb

./

lib/

./Rakefile

./README

./lib/simplegit.rb

./

./lib/ c36

3d4

03e

5b1

1d3

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

Page 140: Git 101 Presentation

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

Working DirectoryIndex

Rakefile

README

simplegit.rb

./

lib/

./Rakefile

./README

./lib/simplegit.rb

./

./lib/ c36

3d4

03e

5b1

1d3

Page 141: Git 101 Presentation

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

Working DirectoryIndex

Rakefile

README

simplegit.rb

./

lib/

./Rakefile

./README

./lib/simplegit.rb

./

./lib/ c36

3d4

03e

5b1

1d3

Page 142: Git 101 Presentation

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

Working DirectoryIndex

Rakefile

README

simplegit.rb

./

lib/

./Rakefile

./README

./lib/simplegit.rb

./

./lib/ c36

3d4

03e

5b1

1d3

Page 143: Git 101 Presentation

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

Working DirectoryIndex

Rakefile

README

simplegit.rb

./

lib/

./Rakefile

./README

./lib/simplegit.rb

./

./lib/ c36

3d4

03e

5b1

1d3

git add

Page 144: Git 101 Presentation

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

Working DirectoryIndex

Rakefile

README

simplegit.rb

./

lib/

./Rakefile

./README

./lib/simplegit.rb

./

./lib/ c36

3d4

03e

5b1

1d3

git add

34f

Page 145: Git 101 Presentation

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

Working DirectoryIndex

Rakefile

README

simplegit.rb

./

lib/

./Rakefile

./README

./lib/simplegit.rb

./

./lib/ c36

3d4

03e

5b1

1d3

git commit

34f

a083da34f

ae9

Page 146: Git 101 Presentation

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

Working DirectoryIndex

Rakefile

README

simplegit.rb

./

lib/

./Rakefile

./README

./lib/simplegit.rb

./

./lib/ c36

3d4

03e

5b1

1d334f

a083da34f

ae9

Page 147: Git 101 Presentation

Repository

3d4

03e

ae6

5b1

1d3

c36

f46

23f

6fe

30e

67e

32a

ffe

38d

5b1

1d3

254

a14

d23

2d3

48e

735

de3

c4ec4e

77d

3d5

Working DirectoryIndex

Rakefile

README

simplegit.rb

./

lib/

./Rakefile

./README

./lib/simplegit.rb

./

./lib/ c36

3d4

03e

5b1

1d334f

a083da34f

ae9

Page 148: Git 101 Presentation

object model

blob

commit

tree

C1}directory list

file contents

pointer to a snapshot

Page 149: Git 101 Presentation

object model

blob

commit

tree

C1}directory list

file contents

pointer to a snapshot

Page 150: Git 101 Presentation

ref

commit commitcommit

tree

treeblob

tree

treeblob

tree

treeblob

blob

Page 151: Git 101 Presentation

Branching and Merging

Page 152: Git 101 Presentation

branches

Page 153: Git 101 Presentation

brancheslightweight, movablepointers to a commit

C1

branch

Page 154: Git 101 Presentation

branching

Page 155: Git 101 Presentation

git branch

Page 156: Git 101 Presentation

git checkout

Page 157: Git 101 Presentation

C1

master

C0

C2 C3

experiment

HEAD

default

Page 158: Git 101 Presentation

C1

master

C0

C2 C3

experimentC1

master

C0

C2 C3

C4

experiment

C5

T1

git branch experiment

HEAD

default

Page 159: Git 101 Presentation

C1

master

C0

C2 C3

experimentC1

master

C0

C2 C3

C4

experiment

C5

T1

git branch experiment

HEAD

default

Page 160: Git 101 Presentation

C1

master

C0

C2 C3

experimentC1

master

C0

C2 C3

C4

experiment

C5

T1

HEAD

$ git branch* default experiment

default

Page 161: Git 101 Presentation

C1

master

C0

C2 C3

experimentC1

master

C0

C2 C3

C4

experiment

C5

T1

HEAD

$ git branch* default experiment

default

Page 162: Git 101 Presentation

C1

master

C0

C2 C3

experimentC1

master

C0

C2 C3

C4

experiment

C5

T1

git checkout experiment

HEAD

default

Page 163: Git 101 Presentation

C1

master

C0

C2 C3

experiment

C1

master

C0

C2 C3

C4

experiment

C5

T1

git commit

HEAD

default

Page 164: Git 101 Presentation

C1

master

C0

C2 C3

experiment

C1

master

C0

C2 C3

C4

experiment

C5

T1

git commit

HEAD

default

Page 165: Git 101 Presentation

C1

master

C0

C2 C3

experiment

C1

master

C0

C2 C3

C4

experiment

C5

T1

git commit

HEAD

default

Page 166: Git 101 Presentation

C1

master

C0

C2 C3

experiment

C1

master

C0

C2 C3

C4

experiment

C5

T1

git commitgit commit

HEAD

default

Page 167: Git 101 Presentation

C1

master

C0

C2 C3

experiment

C1

master

C0

C2 C3

C4

experiment

C5

T1

HEAD

git checkout defaultdefault

Page 168: Git 101 Presentation

C1

master

C0

C2 C3

experiment

C1

master

C0

C2 C3

C4

experiment

C5

T1

HEAD

git checkout defaultdefault

Page 169: Git 101 Presentation

C1

master

C0

C2 C3

C4

experiment

C5

T1

C1

master

C0

C2 C3

C4

experiment

C5

T1git commit

HEAD

default

Page 170: Git 101 Presentation

C1

master

C0

C2 C3

C4

experiment

C5

T1

C1

master

C0

C2 C3

C4

experiment

C5

T1git commit

HEAD

default

Page 171: Git 101 Presentation

C1

master

C0

C2 C3

C4

experiment

C5

T1

C1

master

C0

C2 C3

C4

experiment

C5

T1git commit

HEAD

default

Page 172: Git 101 Presentation

C1

master

C0

C2 C3

C4

experiment

C5

T1

git checkout experimentgit commit

HEAD

default

Page 173: Git 101 Presentation

what is a branch, really?

Page 174: Git 101 Presentation

$ find .git/refs.git/refs.git/refs/heads.git/refs/heads/default.git/refs/heads/experiment

Page 175: Git 101 Presentation

$ find .git/refs.git/refs.git/refs/heads.git/refs/heads/default.git/refs/heads/experiment

Page 176: Git 101 Presentation

$ find .git/refs.git/refs.git/refs/heads.git/refs/heads/default.git/refs/heads/experiment

Page 177: Git 101 Presentation

$ find .git/refs.git/refs.git/refs/heads.git/refs/heads/default.git/refs/heads/experiment

$ cat .git/refs/heads/default6370409dc9e38af91565082bdf93577ff555489e

Page 178: Git 101 Presentation

$ find .git/refs.git/refs.git/refs/heads.git/refs/heads/default.git/refs/heads/experiment

$ cat .git/refs/heads/default6370409dc9e38af91565082bdf93577ff555489e$ cat .git/refs/heads/experiment 33ce13c2f0ed35775956f81191b01a644448dcfc

Page 179: Git 101 Presentation

$ cat .git/HEAD ref: refs/heads/experiment

Page 180: Git 101 Presentation

$ cat .git/HEAD ref: refs/heads/experiment

Page 181: Git 101 Presentation

$ cat .git/HEAD ref: refs/heads/experiment

Page 182: Git 101 Presentation

merging

Page 183: Git 101 Presentation

git merge

Page 184: Git 101 Presentation

C1

master

C0

C2 C3

C4

experiment

C5

T1

HEAD

default

Page 185: Git 101 Presentation

C1

master

C0

C2 C3

C4

experiment

C5

T1

HEAD

git checkout default

default

Page 186: Git 101 Presentation

C1C0

C2 C3

C4

experiment

C5

C6

masterT1

git checkout defaultgit merge experiment

HEAD

default

Page 187: Git 101 Presentation

C1C0

C2 C3

C4

experiment

C5

C6

masterT1

git checkout defaultgit merge experiment

HEAD

default

Page 188: Git 101 Presentation

C1C0

C2 C3

C4

C5

C6

C7

C8

default

experiment

HEADgit checkout experiment

Page 189: Git 101 Presentation

C1C0

C2 C3

C4

C5

C6

C7

C8

default

experiment

HEADgit commit

Page 190: Git 101 Presentation

C1C0

C2 C3

C4

C5

C6

C7

C8

default

experiment

HEAD

git checkout default

Page 191: Git 101 Presentation

C1C0

C2 C3

C4

C5

C6

C7

C8

default

experiment

HEAD

git merge experiment

Page 192: Git 101 Presentation

Why is this cool?

Page 193: Git 101 Presentation

non-linear development

Page 194: Git 101 Presentation

• clone the code that is in production

• create a branch for issue #53 (iss53)

• work for 10 minutes

• someone asks for a hotfix for issue #102

• checkout ‘production’

• create a branch (iss102)

• fix the issue

• checkout ‘production’, merge ‘iss102’

• push ‘production’

• checkout ‘iss53’ and keep working

Page 195: Git 101 Presentation

C0

production

C1origin/master

git clone

Page 196: Git 101 Presentation

C0

production

C1origin/master iss53

git checkout -b iss53

Page 197: Git 101 Presentation

C0

production

C1origin/master

iss53

C2

git commit

Page 198: Git 101 Presentation

C0

production

C1origin/master

iss53

C2

C3

git commit

Page 199: Git 101 Presentation

C0

production

C1origin/master

iss53

C2

C3

iss102

git checkout productiongit checkout -b iss102

Page 200: Git 101 Presentation

C0

production

C1origin/master

iss53

C2

C3 iss102

C4

git commit

Page 201: Git 101 Presentation

C0

production

C1origin/master

iss53

C2

C3

iss102 C4

git checkout productiongit merge iss102

Page 202: Git 101 Presentation

C0

production

C1

origin/master

iss53

C2

C3

C4

git push

Page 203: Git 101 Presentation

C0

production

C1

origin/master

iss53

C2

C3

C4

C5

git checkout iss53git commit

Page 204: Git 101 Presentation

C0

production

C1

origin/master

iss53

C2

C3

C4

C5

iss53v2

git checkout productiongit checkout -b iss53v2

Page 205: Git 101 Presentation

C0

production

C1

origin/master

iss53

C2

C3

C4

C5

iss53v2

C6

C7

git commitgit commit

Page 206: Git 101 Presentation

try out an idea

Page 207: Git 101 Presentation

isolate work units

Page 208: Git 101 Presentation

long running topics

Page 209: Git 101 Presentation

all local, so far

Page 210: Git 101 Presentation

Remotes

Page 211: Git 101 Presentation

sharing git

Page 212: Git 101 Presentation
Page 213: Git 101 Presentation
Page 214: Git 101 Presentation
Page 215: Git 101 Presentation
Page 216: Git 101 Presentation
Page 217: Git 101 Presentation
Page 218: Git 101 Presentation
Page 219: Git 101 Presentation
Page 220: Git 101 Presentation
Page 221: Git 101 Presentation
Page 222: Git 101 Presentation
Page 223: Git 101 Presentation
Page 224: Git 101 Presentation
Page 225: Git 101 Presentation
Page 226: Git 101 Presentation
Page 227: Git 101 Presentation
Page 228: Git 101 Presentation
Page 229: Git 101 Presentation

git clone git://github.com/schacon/simplegit2.git

Page 230: Git 101 Presentation

distributed workflow

Page 231: Git 101 Presentation

distributed workflowfetch, pull and push

Page 232: Git 101 Presentation

fetch

Page 233: Git 101 Presentation
Page 234: Git 101 Presentation
Page 235: Git 101 Presentation
Page 236: Git 101 Presentation
Page 237: Git 101 Presentation
Page 238: Git 101 Presentation
Page 239: Git 101 Presentation

pull

Page 240: Git 101 Presentation

pull = fetch + merge

Page 241: Git 101 Presentation

push

Page 242: Git 101 Presentation
Page 243: Git 101 Presentation
Page 244: Git 101 Presentation
Page 245: Git 101 Presentation

git push

Page 246: Git 101 Presentation
Page 247: Git 101 Presentation

a who in the what now?

Page 248: Git 101 Presentation

public repo

local repo

local repo

public repo

internet

A B C

Page 249: Git 101 Presentation

public repo

local repo

local repo

public repo

git push(ssh)

internet

A B C

A B C

Page 250: Git 101 Presentation

public repo

local repo

local repo

public repo

git push(ssh)

git fetch(git)

internet

A B C

A B C

A B C

Page 251: Git 101 Presentation

public repo

local repo

local repo

public repo

git push(ssh)

git fetch(git)

internet

A B C

A B C

A B C

D E F git commit

Page 252: Git 101 Presentation

public repo

local repo

local repo

public repo

git push(ssh)

git fetch(git)

git push(ssh)

internet

A B C

A B C

A B C

D E F

A B C

D E F

Page 253: Git 101 Presentation

public repo

local repo

local repo

public repo

git fetch(http)

git push(ssh)

git fetch(git)

git push(ssh)

internet

A B C

A B C

A B C

D E F

A B C

D E F

D E F

Page 254: Git 101 Presentation

public repo

local repo

local repo

public repo

git fetch(http)

git push(ssh)

git fetch(git)

git push(ssh)

internet

A B C

A B C

A B C

D E F

A B C

D E F

D E FD E F

Page 255: Git 101 Presentation

multiple remotes

Page 256: Git 101 Presentation

developernick

developerjessica

my repo5ec

e4a4a7ce0 master

Page 257: Git 101 Presentation

developernick

developerjessica

my repo5ec

e4a4a7ce0 master

commit

Page 258: Git 101 Presentation

developernick

developerjessica

my repo5ec

e4a4a7ce0 master

tree

Page 259: Git 101 Presentation

developernick

developerjessica

my repo5ec

e4a4a7ce0 master

blobs

Page 260: Git 101 Presentation

schacon/project

developernick

developerjessica

"public"

my repo5ec

e4a4a7ce0 master

git push public

public/master

5ece4a

4a7ce0

Page 261: Git 101 Presentation

schacon/project

developerjessica

"public"

my repo5ec

e4a4a7ce0 master

git clone (url)

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nick

Page 262: Git 101 Presentation

schacon/project

developerjessica

"public"

my repo5ec

e4a4a7ce0 master

git commit

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

Page 263: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f git clone (url)

5ece4a

4a7ce0developer

jessica

Page 264: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09git commit

Page 265: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09git push

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09

Page 266: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git remote add nick git://github.com/nickh/project.git

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick"

git remote add nick git://github.com/nickh/project.git

Page 267: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git remote add nick git://github.com/nickh/project.git

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick"“nick”

git remote add nick git://github.com/nickh/project.git

Page 268: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git remote add jess git://github.com/jessica/project.git

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

git remote add jess git://github.com/jessica/project.git

Page 269: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git remote add jess git://github.com/jessica/project.git

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

git remote add jess git://github.com/jessica/project.git

“jess”

Page 270: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git remote add jess git://github.com/jessica/project.git

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git fetch nick

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

c12ec524f nick/master

git fetch nick

Page 271: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git fetch nick

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

c12ec524f nick/master

Page 272: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git remote add jess git://github.com/jessica/project.git

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

git fetch jess

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git fetch jess

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

ec524f nick/master

2fbdf74eaa09

jess/masterc12

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git fetch nick

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

c12ec524f nick/master

Page 273: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0 master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git fetch jess

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

ec524f nick/master

2fbdf74eaa09

jess/masterc12

Page 274: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0

master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

ec524f nick/master

2fbdf74eaa09

jess/masterc12

b3bc63

git merge nick jess

Page 275: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0

master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

git push public

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

ec524f nick/master

2fbdf74eaa09

jess/masterc12

b3bc63

e4aec524f

2fbdf74eaa09

c12

b3bc63

Page 276: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0

master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

ec524f nick/master

2fbdf74eaa09

jess/masterc12

b3bc63

e4aec524f

2fbdf74eaa09

c12

b3bc63

Page 277: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0

master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

ec524f nick/master

2fbdf74eaa09

jess/masterc12

b3bc63

e4aec524f

2fbdf74eaa09

c12

b3bc63

Page 278: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0

master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

ec524f nick/master

2fbdf74eaa09

jess/masterc12

b3bc63

e4aec524f

2fbdf74eaa09

c12

b3bc63

Page 279: Git 101 Presentation

schacon/project

"public"

my repo5ec

e4a4a7ce0

master

public/master

5ece4a

4a7ce0

5ece4a

4a7ce0developer

nickc12ec524f

5ece4a

4a7ce0developer

jessica2fbdf74ea

a09

5ece4a

4a7ce0nickh/project

c12ec524f

5ece4a

4a7ce0jessica/project

2fbdf74eaa09"nick" "jess"

ec524f nick/master

2fbdf74eaa09

jess/masterc12

b3bc63

e4aec524f

2fbdf74eaa09

c12

b3bc63

Page 280: Git 101 Presentation

popular workflows

Page 281: Git 101 Presentation

central repository model

Page 282: Git 101 Presentation

developerdeveloper

developer

shared repositorydeveloper

developer

developer

developerdeveloper

developer

Page 283: Git 101 Presentation

developer

shared repository

developer developer

git clone

Page 284: Git 101 Presentation

developer

shared repository

developer developer

git push

Page 285: Git 101 Presentation

developer

shared repository

developer developer

git push

Page 286: Git 101 Presentation

developer

shared repository

developer developer

Page 287: Git 101 Presentation

developer

shared repository

developer developer

git fetchgit merge

Page 288: Git 101 Presentation

developer

shared repository

developer developer

git push

Page 289: Git 101 Presentation

dictator and lieutenants model

Page 290: Git 101 Presentation

developerdeveloper

dictator

developer

lieutenant

blessed repository

developer

lieutenant

Page 291: Git 101 Presentation

developerdeveloper

dictator

developer

lieutenant

blessed repository

developer

lieutenant

git clone

Page 292: Git 101 Presentation

developerdeveloper

dictator

developer

lieutenant

blessed repository

developer

lieutenant

git fetchgit merge

Page 293: Git 101 Presentation

developerdeveloper

dictator

developer

lieutenant

blessed repository

developer

lieutenant

git fetchgit merge

Page 294: Git 101 Presentation

developerdeveloper

dictator

developer

lieutenant

blessed repository

developer

lieutenant

git fetch; git merge

Page 295: Git 101 Presentation

developerdeveloper

dictator

developer

lieutenant

blessed repository

developer

lieutenant

git push

Page 296: Git 101 Presentation

developerdeveloper

dictator

developer

lieutenant

blessed repository

developer

lieutenant

git fetch

Page 297: Git 101 Presentation

integration manager model

Page 298: Git 101 Presentation

developerpublic

developerpublic

integration manager

blessedrepository

developerprivate

developerprivate

Page 299: Git 101 Presentation

developerpublic

developerpublic

integration manager

blessedrepository

developerprivate

developerprivate

github.com/schacon/ticgit

/yob/ticgit /pope/ticgit

Page 300: Git 101 Presentation

developerpublic

developerpublic

integration manager

blessedrepository

developerprivate

developerprivate

github.com/schacon/ticgit

/yob/ticgit /pope/ticgit“forks”

Page 301: Git 101 Presentation

developerpublic

developerpublic

integration manager

blessedrepository

developerprivate

developerprivate

git push

Page 302: Git 101 Presentation

developerpublic

developerpublic

integration manager

blessedrepository

developerprivate

developerprivate

git clone

Page 303: Git 101 Presentation

developerpublic

developerpublic

integration manager

blessedrepository

developerprivate

developerprivate

git push

Page 304: Git 101 Presentation

developerpublic

developerpublic

integration manager

blessedrepository

developerprivate

developerprivate

git fetchgit merge

Page 305: Git 101 Presentation

developerpublic

developerpublic

integration manager

blessedrepository

developerprivate

developerprivate

git push

Page 306: Git 101 Presentation

developerpublic

developerpublic

integration manager

blessedrepository

developerprivate

developerprivate

git fetchgit merge

Page 307: Git 101 Presentation

developerpublic

developerpublic

integration manager

blessedrepository

developerprivate

developerprivate

git push

Page 308: Git 101 Presentation

Remotes Are Branches

Page 309: Git 101 Presentation

C0

default

scott jessica

C1

Page 310: Git 101 Presentation

C0

default

scott jessica

C1

C0

scott/default default

C1

Page 311: Git 101 Presentation

C0

default

scott jessica

C1

C0

scott/default default

C1

git clone

Page 312: Git 101 Presentation

C0

default

scott jessica

C1

C0

scott/default default

C1

Page 313: Git 101 Presentation

C0

default

scott jessica

C1

C0

scott/default default

C1

Page 314: Git 101 Presentation

C0

default

scott jessica

C1 C1

C0

scott/default

default

C2

C3

C4

Page 315: Git 101 Presentation

C0

default

scott jessica

C1 C1

C0

scott/default

default

C2

C3

C4

Page 316: Git 101 Presentation

C0

default

scott jessica

C1 C1

C0

scott/default

default

C2

C3

C4

Page 317: Git 101 Presentation

C0

default

scott

C1

C5

C6

C7

jessica

C1

C0

scott/default

default

C2

C3

C4

Page 318: Git 101 Presentation

C0

default

scott

C1

C5

C6

C7

jessica

C1

C0

scott/default

default

C2

C3

C4

Page 319: Git 101 Presentation

C0

default

scott jessica

C1

C0

scott/default default

C2

C3

C4

C1

C5

C6

C7

C5

C6

C7

Page 320: Git 101 Presentation

C0

default

scott jessica

C1

C0

scott/default default

C2

C3

C4

C1

C5

C6

C7

C5

C6

C7

experiment

C8

C9

Page 321: Git 101 Presentation

C0

default

scott jessica

C1

C0

scott/default default

C2

C3

C4

C1

C5

C6

C7

C5

C6

C7

experiment

C8

C9

Page 322: Git 101 Presentation

C0

default

scott jessica

C1

C0

scott/default default

C2

C3

C4

C1

C5

C6

C7

C5

C6

C7

experiment

C8

C9

git merge experiment

git merge scott/default

Page 323: Git 101 Presentation

C0

default

scott jessica

C1

C0

scott/default default

C2

C3

C4

C1

C5

C6

C7

C5

C6

C7

experiment

C8

C9

Page 324: Git 101 Presentation

C0

default

scott jessica

C1

C0

scott/default default

C2

C3

C4

C1

C5

C6

C7

C5

C6

C7

experiment

C8

C9

a “remote” branch is simply alocal pointer to the last known

state of another repository

Page 325: Git 101 Presentation

Tagging

Page 326: Git 101 Presentation

lightweight tags

Page 327: Git 101 Presentation

Snapshot A Snapshot B Snapshot C

98ca9 34ac2 f30ab

master

HEAD

Page 328: Git 101 Presentation

git tag v1.0

Page 329: Git 101 Presentation

Snapshot A Snapshot B Snapshot C

98ca9 34ac2 f30ab

master

HEAD

v1.0

Page 330: Git 101 Presentation

Snapshot A Snapshot B Snapshot C

98ca9 34ac2 f30ab

master

HEAD

v1.0

Snapshot D

a38d3

Page 331: Git 101 Presentation

annotated tags

Page 332: Git 101 Presentation

git tag -a v1.1 34ac2

Page 333: Git 101 Presentation

tag size

49e11..

object

type

tagger

my tag message that explains

this tag

ae668

commit

Scott

tag v1.3

Page 334: Git 101 Presentation

Snapshot A Snapshot B Snapshot C

98ca9 34ac2 f30ab

master

HEAD

v1.0

Snapshot D

a38d3

tag data

v1.1

Page 335: Git 101 Presentation

Changes

Page 336: Git 101 Presentation

deltastorage

snapshotstorage

Page 337: Git 101 Presentation

deltastorage

snapshotstorage

Page 338: Git 101 Presentation

deltastorage

snapshotstorage

Page 339: Git 101 Presentation

git diff

Page 340: Git 101 Presentation
Page 341: Git 101 Presentation

What is not yet staged?

Page 342: Git 101 Presentation

git diff

Page 343: Git 101 Presentation

git diff

working directory

repository

index

Page 344: Git 101 Presentation

What is staged?

Page 345: Git 101 Presentation

git diff --cached

Page 346: Git 101 Presentation

git diff --cached

working directory

repository

index

Page 347: Git 101 Presentation

Unified Diff

Page 348: Git 101 Presentation

git diff > change.patch

Page 349: Git 101 Presentation

git diff > change.patch

patch -p1 < change.patch

Page 350: Git 101 Presentation

git diff > change.patch

patch -p1 < change.patch

git apply change.patchor

Page 351: Git 101 Presentation

History

Page 352: Git 101 Presentation

git log

Page 353: Git 101 Presentation
Page 354: Git 101 Presentation
Page 355: Git 101 Presentation
Page 356: Git 101 Presentation
Page 357: Git 101 Presentation
Page 358: Git 101 Presentation
Page 359: Git 101 Presentation
Page 360: Git 101 Presentation
Page 361: Git 101 Presentation

What am I about to submit?

Page 362: Git 101 Presentation

git log [branch]..

Page 363: Git 101 Presentation

git log origin/master..

Page 364: Git 101 Presentation

git log origin/master..

what you’ve committed that isn’t pushed yet

Page 365: Git 101 Presentation

Stashing

Page 366: Git 101 Presentation

when a commit is too much

Page 367: Git 101 Presentation

$ git status# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stashSaved working directory and index state "WIP on iss53: c8208f9... Merge branch 'cupcake'"HEAD is now at c8208f9 Merge branch 'cupcake'(To restore them type "git stash apply")

$ git status# On branch iss53nothing to commit (working directory clean)

Page 368: Git 101 Presentation

$ git status# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stashSaved working directory and index state "WIP on iss53: c8208f9... Merge branch 'cupcake'"HEAD is now at c8208f9 Merge branch 'cupcake'(To restore them type "git stash apply")

$ git status# On branch iss53nothing to commit (working directory clean)

Page 369: Git 101 Presentation

$ git status# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stashSaved working directory and index state "WIP on iss53: c8208f9... Merge branch 'cupcake'"HEAD is now at c8208f9 Merge branch 'cupcake'(To restore them type "git stash apply")

$ git status# On branch iss53nothing to commit (working directory clean)

Page 370: Git 101 Presentation

$ git status# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stashSaved working directory and index state "WIP on iss53: c8208f9... Merge branch 'cupcake'"HEAD is now at c8208f9 Merge branch 'cupcake'(To restore them type "git stash apply")

$ git status# On branch iss53nothing to commit (working directory clean)

Page 371: Git 101 Presentation

$ git status# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stashSaved working directory and index state "WIP on iss53: c8208f9... Merge branch 'cupcake'"HEAD is now at c8208f9 Merge branch 'cupcake'(To restore them type "git stash apply")

$ git status# On branch iss53nothing to commit (working directory clean)

Page 372: Git 101 Presentation

$ git status# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stashSaved working directory and index state "WIP on iss53: c8208f9... Merge branch 'cupcake'"HEAD is now at c8208f9 Merge branch 'cupcake'(To restore them type "git stash apply")

$ git status# On branch iss53nothing to commit (working directory clean)

Page 373: Git 101 Presentation

$ git status# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stashSaved working directory and index state "WIP on iss53: c8208f9... Merge branch 'cupcake'"HEAD is now at c8208f9 Merge branch 'cupcake'(To restore them type "git stash apply")

$ git status# On branch iss53nothing to commit (working directory clean)

Page 374: Git 101 Presentation

$ git status# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stashSaved working directory and index state "WIP on iss53: c8208f9... Merge branch 'cupcake'"HEAD is now at c8208f9 Merge branch 'cupcake'(To restore them type "git stash apply")

$ git status# On branch iss53nothing to commit (working directory clean)

Page 375: Git 101 Presentation

$ git status# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stashSaved working directory and index state "WIP on iss53: c8208f9... Merge branch 'cupcake'"HEAD is now at c8208f9 Merge branch 'cupcake'(To restore them type "git stash apply")

$ git status# On branch iss53nothing to commit (working directory clean)

Page 376: Git 101 Presentation

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash apply# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash drop stash@{0}Dropped stash@{0} (e19b0e94032d0614f450238f91953fe5e7e454a8)

Page 377: Git 101 Presentation

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash apply# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash drop stash@{0}Dropped stash@{0} (e19b0e94032d0614f450238f91953fe5e7e454a8)

Page 378: Git 101 Presentation

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash apply# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash drop stash@{0}Dropped stash@{0} (e19b0e94032d0614f450238f91953fe5e7e454a8)

Page 379: Git 101 Presentation

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash apply# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash drop stash@{0}Dropped stash@{0} (e19b0e94032d0614f450238f91953fe5e7e454a8)

Page 380: Git 101 Presentation

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash apply# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash drop stash@{0}Dropped stash@{0} (e19b0e94032d0614f450238f91953fe5e7e454a8)

Page 381: Git 101 Presentation

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash apply# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash drop stash@{0}Dropped stash@{0} (e19b0e94032d0614f450238f91953fe5e7e454a8)

Page 382: Git 101 Presentation

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash apply# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash drop stash@{0}Dropped stash@{0} (e19b0e94032d0614f450238f91953fe5e7e454a8)

Page 383: Git 101 Presentation

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash apply# On branch iss53# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: src/com/android/alarmclock/AlarmAlert.java# modified: src/com/android/alarmclock/AlarmAlertWakeLock.java#no changes added to commit (use "git add" and/or "git commit -a")

$ git stash liststash@{0}: WIP on iss53: c8208f9... Merge branch 'cupcake'

$ git stash drop stash@{0}Dropped stash@{0} (e19b0e94032d0614f450238f91953fe5e7e454a8)

Page 384: Git 101 Presentation

git stash

save

list

drop

pop

apply

Page 385: Git 101 Presentation

Bulk Staging

Page 386: Git 101 Presentation

working directory

repository

index

Page 387: Git 101 Presentation

working directory

repository

index

git add

Page 388: Git 101 Presentation

working directory

repository

index

git addgit add

git add

Page 389: Git 101 Presentation

working directory

repository

index

git add

git commit

Page 390: Git 101 Presentation

git add -u

Page 391: Git 101 Presentation

git commit -a

Page 392: Git 101 Presentation

working directory

repository

git commit -aindex

Page 393: Git 101 Presentation

git commit -agit add -ugit commit

Page 394: Git 101 Presentation

Git Help

Page 395: Git 101 Presentation

git [command] --help

Page 396: Git 101 Presentation

git help [command]

Page 397: Git 101 Presentation

git-scm.com

Page 398: Git 101 Presentation

git-scm.com

Page 399: Git 101 Presentation
Page 400: Git 101 Presentation
Page 401: Git 101 Presentation
Page 402: Git 101 Presentation
Page 403: Git 101 Presentation
Page 404: Git 101 Presentation
Page 405: Git 101 Presentation
Page 406: Git 101 Presentation

that’s it!

Page 407: Git 101 Presentation

merci

Page 408: Git 101 Presentation

Resources

• git-scm.com

• progit.org

• github.com

• #git / #github on IRC

• gitcasts.com

[email protected]

Patricks Irish Pub33, rue de Montreuil8pm, tonight

Page 409: Git 101 Presentation

git ninja training

Page 410: Git 101 Presentation

Patch Staging

Page 411: Git 101 Presentation

git add -p

Page 412: Git 101 Presentation

$ git status# On branch master# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)##modified: ticgit.gemspec#no changes added to commit (use "git add" and/or "git commit -a")

Page 413: Git 101 Presentation

$ git status# On branch master# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)##modified: ticgit.gemspec#no changes added to commit (use "git add" and/or "git commit -a")

Page 414: Git 101 Presentation

$ git add -pdiff --git a/ticgit.gemspec b/ticgit.gemspecindex 9c32bd4..a44667b 100644--- a/ticgit.gemspec+++ b/ticgit.gemspec@@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "ticgit"- s.version = "0.3.5"+ s.version = "0.3.6" s.date = "2008-05-10" s.author = "Scott Chacon" s.email = "[email protected]"Stage this hunk [y,n,a,d,/,j,J,g,e,?]? y

Page 415: Git 101 Presentation

$ git add -pdiff --git a/ticgit.gemspec b/ticgit.gemspecindex 9c32bd4..a44667b 100644--- a/ticgit.gemspec+++ b/ticgit.gemspec@@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "ticgit"- s.version = "0.3.5"+ s.version = "0.3.6" s.date = "2008-05-10" s.author = "Scott Chacon" s.email = "[email protected]"Stage this hunk [y,n,a,d,/,j,J,g,e,?]? y

Page 416: Git 101 Presentation

$ git add -pdiff --git a/ticgit.gemspec b/ticgit.gemspecindex 9c32bd4..a44667b 100644--- a/ticgit.gemspec+++ b/ticgit.gemspec@@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "ticgit"- s.version = "0.3.5"+ s.version = "0.3.6" s.date = "2008-05-10" s.author = "Scott Chacon" s.email = "[email protected]"Stage this hunk [y,n,a,d,/,j,J,g,e,?]?

Page 417: Git 101 Presentation

$ git add -pdiff --git a/ticgit.gemspec b/ticgit.gemspecindex 9c32bd4..a44667b 100644--- a/ticgit.gemspec+++ b/ticgit.gemspec@@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "ticgit"- s.version = "0.3.5"+ s.version = "0.3.6" s.date = "2008-05-10" s.author = "Scott Chacon" s.email = "[email protected]"Stage this hunk [y,n,a,d,/,j,J,g,e,?]? y

Page 418: Git 101 Presentation

@@ -9,9 +9,10 @@ Gem::Specification.new do |s| s.files = ["lib/ticgit/base.rb", "lib/ticgit/cli.rb", "lib/ticgit/comment.rb", "lib/ticgit/ticket.rb", "lib/ticgit.rb", "bin/ti", "bin/ticgitweb"] s.bindir = 'bin'- s.executables << "ti"- s.executables << "ticgitweb"+ s.executables = ["ti", "ticgitweb"]+ s.default_executable = %q{ti} s.homepage = "http://github/schacon/ticgit" s.require_paths = ["lib", "bin"]+ s.specification_version = 2 if s.respond_to? :specification_version= endStage this hunk [y,n,a,d,/,K,g,s,e,?]?

Page 419: Git 101 Presentation

@@ -9,9 +9,10 @@ Gem::Specification.new do |s| s.files = ["lib/ticgit/base.rb", "lib/ticgit/cli.rb", "lib/ticgit/comment.rb", "lib/ticgit/ticket.rb", "lib/ticgit.rb", "bin/ti", "bin/ticgitweb"] s.bindir = 'bin'- s.executables << "ti"- s.executables << "ticgitweb"+ s.executables = ["ti", "ticgitweb"]+ s.default_executable = %q{ti} s.homepage = "http://github/schacon/ticgit" s.require_paths = ["lib", "bin"]+ s.specification_version = 2 if s.respond_to? :specification_version= endStage this hunk [y,n,a,d,/,K,g,s,e,?]?

Page 420: Git 101 Presentation

@@ -9,9 +9,10 @@ Gem::Specification.new do |s| s.files = ["lib/ticgit/base.rb", "lib/ticgit/cli.rb", "lib/ticgit/comment.rb", "lib/ticgit/ticket.rb", "lib/ticgit.rb", "bin/ti", "bin/ticgitweb"] s.bindir = 'bin'- s.executables << "ti"- s.executables << "ticgitweb"+ s.executables = ["ti", "ticgitweb"]+ s.default_executable = %q{ti} s.homepage = "http://github/schacon/ticgit" s.require_paths = ["lib", "bin"]+ s.specification_version = 2 if s.respond_to? :specification_version= endStage this hunk [y,n,a,d,/,K,g,s,e,?]? n

Page 421: Git 101 Presentation

$ git status# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: ticgit.gemspec## Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: ticgit.gemspec#

Page 422: Git 101 Presentation

$ git status# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: ticgit.gemspec## Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: ticgit.gemspec#

Page 423: Git 101 Presentation

$ git status# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: ticgit.gemspec## Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: ticgit.gemspec#

Page 424: Git 101 Presentation

$ git status# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## modified: ticgit.gemspec## Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: ticgit.gemspec#

Page 425: Git 101 Presentation

partially stage files

Page 426: Git 101 Presentation

git add -p

Page 427: Git 101 Presentation

Annotation

Page 428: Git 101 Presentation

git blame

Page 429: Git 101 Presentation

git blameie: “what dumbass did this? oh, it was me...”

Page 430: Git 101 Presentation

git blame daemon.c979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 5) 85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 6) #include <syslog.h>85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 7) 695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 8) #ifndef HOST_NAME_MAX695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST_NAME_MAX 256695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 10) #endif695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 11) 415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 12) #ifndef NI_MAXSERV415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 13) #define NI_MAXSERV 32415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 14) #endif415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 15) 9048fe1c (Petr Baudis 2005-09-24 16:13:01 +0200 16) static int log_syslog;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 17) static int verbose;1955fabf (Mark Wooding 2006-02-03 20:27:04 +0000 18) static int reuseaddr;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 19) 960deccb (H. Peter Anvin 2005-10-19 14:27:01 -0700 20) static const char daemon_usage[] =1b1dd23f (Stephan Beyer 2008-07-13 15:36:15 +0200 21) "git daemon [--verbose] [--syslog] [3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 22) " [--timeout=n] [--init-ti3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 23) " [--strict-paths] [--base73a7a656 (Jens Axboe 2007-07-27 14:00:29 -0700 24) " [--user-path | --user-pa49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 25) " [--interpolated-path=pat678dac6b (Tilman Sauerbeck 2006-08-22 19:37:41 +0200 26) " [--reuseaddr] [--detach]d9edcbd6 (Junio C Hamano 2006-09-07 01:40:04 -0700 27) " [--[enable|disable|allowdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 28) " [--inetd | [--listen=hosdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 29) " [--user=user dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 30) " [directory...]";4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 31) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 32) /* List of acceptable pathname prefi96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 33) static char **ok_paths;96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 34) static int strict_paths;4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 35) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 36) /* If this is set, git-daemon-export96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 37) static int export_all_trees;

Page 431: Git 101 Presentation

git blame daemon.c979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 5) 85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 6) #include <syslog.h>85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 7) 695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 8) #ifndef HOST_NAME_MAX695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST_NAME_MAX 256695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 10) #endif695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 11) 415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 12) #ifndef NI_MAXSERV415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 13) #define NI_MAXSERV 32415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 14) #endif415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 15) 9048fe1c (Petr Baudis 2005-09-24 16:13:01 +0200 16) static int log_syslog;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 17) static int verbose;1955fabf (Mark Wooding 2006-02-03 20:27:04 +0000 18) static int reuseaddr;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 19) 960deccb (H. Peter Anvin 2005-10-19 14:27:01 -0700 20) static const char daemon_usage[] =1b1dd23f (Stephan Beyer 2008-07-13 15:36:15 +0200 21) "git daemon [--verbose] [--syslog] [3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 22) " [--timeout=n] [--init-ti3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 23) " [--strict-paths] [--base73a7a656 (Jens Axboe 2007-07-27 14:00:29 -0700 24) " [--user-path | --user-pa49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 25) " [--interpolated-path=pat678dac6b (Tilman Sauerbeck 2006-08-22 19:37:41 +0200 26) " [--reuseaddr] [--detach]d9edcbd6 (Junio C Hamano 2006-09-07 01:40:04 -0700 27) " [--[enable|disable|allowdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 28) " [--inetd | [--listen=hosdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 29) " [--user=user dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 30) " [directory...]";4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 31) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 32) /* List of acceptable pathname prefi96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 33) static char **ok_paths;96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 34) static int strict_paths;4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 35) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 36) /* If this is set, git-daemon-export96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 37) static int export_all_trees;

Page 432: Git 101 Presentation

git blame daemon.c979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 5) 85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 6) #include <syslog.h>85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 7) 695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 8) #ifndef HOST_NAME_MAX695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST_NAME_MAX 256695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 10) #endif695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 11) 415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 12) #ifndef NI_MAXSERV415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 13) #define NI_MAXSERV 32415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 14) #endif415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 15) 9048fe1c (Petr Baudis 2005-09-24 16:13:01 +0200 16) static int log_syslog;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 17) static int verbose;1955fabf (Mark Wooding 2006-02-03 20:27:04 +0000 18) static int reuseaddr;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 19) 960deccb (H. Peter Anvin 2005-10-19 14:27:01 -0700 20) static const char daemon_usage[] =1b1dd23f (Stephan Beyer 2008-07-13 15:36:15 +0200 21) "git daemon [--verbose] [--syslog] [3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 22) " [--timeout=n] [--init-ti3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 23) " [--strict-paths] [--base73a7a656 (Jens Axboe 2007-07-27 14:00:29 -0700 24) " [--user-path | --user-pa49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 25) " [--interpolated-path=pat678dac6b (Tilman Sauerbeck 2006-08-22 19:37:41 +0200 26) " [--reuseaddr] [--detach]d9edcbd6 (Junio C Hamano 2006-09-07 01:40:04 -0700 27) " [--[enable|disable|allowdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 28) " [--inetd | [--listen=hosdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 29) " [--user=user dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 30) " [directory...]";4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 31) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 32) /* List of acceptable pathname prefi96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 33) static char **ok_paths;96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 34) static int strict_paths;4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 35) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 36) /* If this is set, git-daemon-export96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 37) static int export_all_trees;

Page 433: Git 101 Presentation

979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 5) 85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 6) #include <syslog.h>85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 7) 695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 8) #ifndef HOST_NAME_MAX695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST_NAME_MAX 256695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 10) #endif695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 11) 415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 12) #ifndef NI_MAXSERV415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 13) #define NI_MAXSERV 32415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 14) #endif415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 15) 9048fe1c (Petr Baudis 2005-09-24 16:13:01 +0200 16) static int log_syslog;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 17) static int verbose;1955fabf (Mark Wooding 2006-02-03 20:27:04 +0000 18) static int reuseaddr;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 19) 960deccb (H. Peter Anvin 2005-10-19 14:27:01 -0700 20) static const char daemon_usage[] =1b1dd23f (Stephan Beyer 2008-07-13 15:36:15 +0200 21) "git daemon [--verbose] [--syslog] [3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 22) " [--timeout=n] [--init-ti3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 23) " [--strict-paths] [--base73a7a656 (Jens Axboe 2007-07-27 14:00:29 -0700 24) " [--user-path | --user-pa49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 25) " [--interpolated-path=pat678dac6b (Tilman Sauerbeck 2006-08-22 19:37:41 +0200 26) " [--reuseaddr] [--detach]d9edcbd6 (Junio C Hamano 2006-09-07 01:40:04 -0700 27) " [--[enable|disable|allowdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 28) " [--inetd | [--listen=hosdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 29) " [--user=user dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 30) " [directory...]";4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 31) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 32) /* List of acceptable pathname prefi96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 33) static char **ok_paths;96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 34) static int strict_paths;4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 35) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 36) /* If this is set, git-daemon-export96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 37) static int export_all_trees;

git blame daemon.c

Page 434: Git 101 Presentation

979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 5) 85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 6) #include <syslog.h>85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 7) 695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 8) #ifndef HOST_NAME_MAX695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST_NAME_MAX 256695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 10) #endif695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 11) 415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 12) #ifndef NI_MAXSERV415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 13) #define NI_MAXSERV 32415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 14) #endif415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 15) 9048fe1c (Petr Baudis 2005-09-24 16:13:01 +0200 16) static int log_syslog;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 17) static int verbose;1955fabf (Mark Wooding 2006-02-03 20:27:04 +0000 18) static int reuseaddr;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 19) 960deccb (H. Peter Anvin 2005-10-19 14:27:01 -0700 20) static const char daemon_usage[] =1b1dd23f (Stephan Beyer 2008-07-13 15:36:15 +0200 21) "git daemon [--verbose] [--syslog] [3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 22) " [--timeout=n] [--init-ti3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 23) " [--strict-paths] [--base73a7a656 (Jens Axboe 2007-07-27 14:00:29 -0700 24) " [--user-path | --user-pa49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 25) " [--interpolated-path=pat678dac6b (Tilman Sauerbeck 2006-08-22 19:37:41 +0200 26) " [--reuseaddr] [--detach]d9edcbd6 (Junio C Hamano 2006-09-07 01:40:04 -0700 27) " [--[enable|disable|allowdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 28) " [--inetd | [--listen=hosdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 29) " [--user=user dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 30) " [directory...]";4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 31) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 32) /* List of acceptable pathname prefi96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 33) static char **ok_paths;96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 34) static int strict_paths;4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 35) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 36) /* If this is set, git-daemon-export96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 37) static int export_all_trees;

git blame daemon.c

Page 435: Git 101 Presentation

979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 5) 85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 6) #include <syslog.h>85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 7) 695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 8) #ifndef HOST_NAME_MAX695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST_NAME_MAX 256695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 10) #endif695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 11) 415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 12) #ifndef NI_MAXSERV415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 13) #define NI_MAXSERV 32415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 14) #endif415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 15) 9048fe1c (Petr Baudis 2005-09-24 16:13:01 +0200 16) static int log_syslog;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 17) static int verbose;1955fabf (Mark Wooding 2006-02-03 20:27:04 +0000 18) static int reuseaddr;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 19) 960deccb (H. Peter Anvin 2005-10-19 14:27:01 -0700 20) static const char daemon_usage[] =1b1dd23f (Stephan Beyer 2008-07-13 15:36:15 +0200 21) "git daemon [--verbose] [--syslog] [3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 22) " [--timeout=n] [--init-ti3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 23) " [--strict-paths] [--base73a7a656 (Jens Axboe 2007-07-27 14:00:29 -0700 24) " [--user-path | --user-pa49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 25) " [--interpolated-path=pat678dac6b (Tilman Sauerbeck 2006-08-22 19:37:41 +0200 26) " [--reuseaddr] [--detach]d9edcbd6 (Junio C Hamano 2006-09-07 01:40:04 -0700 27) " [--[enable|disable|allowdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 28) " [--inetd | [--listen=hosdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 29) " [--user=user dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 30) " [directory...]";4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 31) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 32) /* List of acceptable pathname prefi96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 33) static char **ok_paths;96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 34) static int strict_paths;4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 35) 4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 36) /* If this is set, git-daemon-export96f1e58f (David Rientjes 2006-08-15 10:23:48 -0700 37) static int export_all_trees;

git blame daemon.c

Page 436: Git 101 Presentation

git blame -C GITPackUpload.m

Page 437: Git 101 Presentation

git blame -C GITPackUpload.mf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 12) f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 13) #define PACK_SIGNf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 14) #define PACK_VERSf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 15) ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 16) @implementation Gad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 17) ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 18) @synthesize gitRead11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 19) @synthesize needRad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 20) @synthesize gitSoad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 21) @synthesize refDiad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 22) a2cbabf5 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-25 22:29:39 +0100 23) - (id) initWithGiad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 24) {a2cbabf5 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-25 22:29:39 +0100 25) gitRepo = ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 26) needRefs =ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 27) gitSocket ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 28) return selad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 29) }ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 30) ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 31) - (bool) uploadPaf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 32) {f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 33) NSLog(@"upf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 34) NSString *f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 35) NSArray *tf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 36) 56ef2caf Source/Network/GITServerHandler.m (Scott Chacon 2009-01-05 21:44:26 -0800 37) refDict = f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 38)

Page 438: Git 101 Presentation

f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 12) f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 13) #define PACK_SIGNf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 14) #define PACK_VERSf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 15) ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 16) @implementation Gad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 17) ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 18) @synthesize gitRead11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 19) @synthesize needRad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 20) @synthesize gitSoad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 21) @synthesize refDiad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 22) a2cbabf5 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-25 22:29:39 +0100 23) - (id) initWithGiad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 24) {a2cbabf5 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-25 22:29:39 +0100 25) gitRepo = ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 26) needRefs =ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 27) gitSocket ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 28) return selad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 29) }ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 30) ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 31) - (bool) uploadPaf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 32) {f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 33) NSLog(@"upf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 34) NSString *f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 35) NSArray *tf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 36) 56ef2caf Source/Network/GITServerHandler.m (Scott Chacon 2009-01-05 21:44:26 -0800 37) refDict = f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 38)

git blame -C GITPackUpload.m

Page 439: Git 101 Presentation

f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 12) f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 13) #define PACK_SIGNf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 14) #define PACK_VERSf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 15) ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 16) @implementation Gad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 17) ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 18) @synthesize gitRead11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 19) @synthesize needRad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 20) @synthesize gitSoad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 21) @synthesize refDiad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 22) a2cbabf5 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-25 22:29:39 +0100 23) - (id) initWithGiad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 24) {a2cbabf5 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-25 22:29:39 +0100 25) gitRepo = ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 26) needRefs =ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 27) gitSocket ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 28) return selad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 29) }ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 30) ad11ac80 Source/Network/GITPackUpload.m (Scott Chacon 2009-03-24 18:32:50 +0100 31) - (bool) uploadPaf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 32) {f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 33) NSLog(@"upf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 34) NSString *f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 35) NSArray *tf344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 36) 56ef2caf Source/Network/GITServerHandler.m (Scott Chacon 2009-01-05 21:44:26 -0800 37) refDict = f344f58d Source/Network/GITServerHandler.m (Scott Chacon 2009-01-04 18:59:04 -0800 38)

git blame -C GITPackUpload.m

Page 440: Git 101 Presentation

Bisecting

Page 441: Git 101 Presentation

binary search for where a bug was introduced

Page 442: Git 101 Presentation

$ git bisect start$ git bisect bad$ git bisect good 3acb4c2c6666ed6cb91cb0b983efe9d50cf8cfbeBisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo$ git bisect goodBisecting: 3 revisions left to test after this[b047b02ea83310a70fd603dc8cd7a6cd13d15c04] secure this thing$ git bisect badBisecting: 1 revisions left to test after this[f71ce38690acf49c1f3c9bea38e09d82a5ce6014] drop exceptions table and$ git bisect goodb047b02ea83310a70fd603dc8cd7a6cd13d15c04 is first bad commitcommit b047b02ea83310a70fd603dc8cd7a6cd13d15c04Author: PJ Hyett <[email protected]>Date: Tue Jan 27 14:48:32 2009 -0800

secure this thing

:040000 040000 40ee3e7821b895e52c1695092db9bdc4c61d1730 f24d3c6ebcfc639b1a3814550e62d60b8e68a8e4 M config

Page 443: Git 101 Presentation

$ git bisect start$ git bisect bad$ git bisect good 3acb4c2c6666ed6cb91cb0b983efe9d50cf8cfbeBisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo$ git bisect goodBisecting: 3 revisions left to test after this[b047b02ea83310a70fd603dc8cd7a6cd13d15c04] secure this thing$ git bisect badBisecting: 1 revisions left to test after this[f71ce38690acf49c1f3c9bea38e09d82a5ce6014] drop exceptions table and$ git bisect goodb047b02ea83310a70fd603dc8cd7a6cd13d15c04 is first bad commitcommit b047b02ea83310a70fd603dc8cd7a6cd13d15c04Author: PJ Hyett <[email protected]>Date: Tue Jan 27 14:48:32 2009 -0800

secure this thing

:040000 040000 40ee3e7821b895e52c1695092db9bdc4c61d1730 f24d3c6ebcfc639b1a3814550e62d60b8e68a8e4 M config

Page 444: Git 101 Presentation

$ git bisect start$ git bisect bad$ git bisect good 3acb4c2c6666ed6cb91cb0b983efe9d50cf8cfbeBisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo$ git bisect goodBisecting: 3 revisions left to test after this[b047b02ea83310a70fd603dc8cd7a6cd13d15c04] secure this thing$ git bisect badBisecting: 1 revisions left to test after this[f71ce38690acf49c1f3c9bea38e09d82a5ce6014] drop exceptions table and$ git bisect goodb047b02ea83310a70fd603dc8cd7a6cd13d15c04 is first bad commitcommit b047b02ea83310a70fd603dc8cd7a6cd13d15c04Author: PJ Hyett <[email protected]>Date: Tue Jan 27 14:48:32 2009 -0800

secure this thing

:040000 040000 40ee3e7821b895e52c1695092db9bdc4c61d1730 f24d3c6ebcfc639b1a3814550e62d60b8e68a8e4 M config

Page 445: Git 101 Presentation

$ git bisect start$ git bisect bad$ git bisect good 3acb4c2c6666ed6cb91cb0b983efe9d50cf8cfbeBisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo$ git bisect goodBisecting: 3 revisions left to test after this[b047b02ea83310a70fd603dc8cd7a6cd13d15c04] secure this thing$ git bisect badBisecting: 1 revisions left to test after this[f71ce38690acf49c1f3c9bea38e09d82a5ce6014] drop exceptions table and$ git bisect goodb047b02ea83310a70fd603dc8cd7a6cd13d15c04 is first bad commitcommit b047b02ea83310a70fd603dc8cd7a6cd13d15c04Author: PJ Hyett <[email protected]>Date: Tue Jan 27 14:48:32 2009 -0800

secure this thing

:040000 040000 40ee3e7821b895e52c1695092db9bdc4c61d1730 f24d3c6ebcfc639b1a3814550e62d60b8e68a8e4 M config

Page 446: Git 101 Presentation

$ git bisect start$ git bisect bad$ git bisect good 3acb4c2c6666ed6cb91cb0b983efe9d50cf8cfbeBisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo$ git bisect goodBisecting: 3 revisions left to test after this[b047b02ea83310a70fd603dc8cd7a6cd13d15c04] secure this thing$ git bisect badBisecting: 1 revisions left to test after this[f71ce38690acf49c1f3c9bea38e09d82a5ce6014] drop exceptions table and$ git bisect goodb047b02ea83310a70fd603dc8cd7a6cd13d15c04 is first bad commitcommit b047b02ea83310a70fd603dc8cd7a6cd13d15c04Author: PJ Hyett <[email protected]>Date: Tue Jan 27 14:48:32 2009 -0800

secure this thing

:040000 040000 40ee3e7821b895e52c1695092db9bdc4c61d1730 f24d3c6ebcfc639b1a3814550e62d60b8e68a8e4 M config

Page 447: Git 101 Presentation

$ git bisect start$ git bisect bad$ git bisect good 3acb4c2c6666ed6cb91cb0b983efe9d50cf8cfbeBisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo$ git bisect goodBisecting: 3 revisions left to test after this[b047b02ea83310a70fd603dc8cd7a6cd13d15c04] secure this thing$ git bisect badBisecting: 1 revisions left to test after this[f71ce38690acf49c1f3c9bea38e09d82a5ce6014] drop exceptions table and$ git bisect goodb047b02ea83310a70fd603dc8cd7a6cd13d15c04 is first bad commitcommit b047b02ea83310a70fd603dc8cd7a6cd13d15c04Author: PJ Hyett <[email protected]>Date: Tue Jan 27 14:48:32 2009 -0800

secure this thing

:040000 040000 40ee3e7821b895e52c1695092db9bdc4c61d1730 f24d3c6ebcfc639b1a3814550e62d60b8e68a8e4 M config

Page 448: Git 101 Presentation

$ git bisect start$ git bisect bad$ git bisect good 3acb4c2c6666ed6cb91cb0b983efe9d50cf8cfbeBisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo$ git bisect goodBisecting: 3 revisions left to test after this[b047b02ea83310a70fd603dc8cd7a6cd13d15c04] secure this thing$ git bisect badBisecting: 1 revisions left to test after this[f71ce38690acf49c1f3c9bea38e09d82a5ce6014] drop exceptions table and$ git bisect goodb047b02ea83310a70fd603dc8cd7a6cd13d15c04 is first bad commitcommit b047b02ea83310a70fd603dc8cd7a6cd13d15c04Author: PJ Hyett <[email protected]>Date: Tue Jan 27 14:48:32 2009 -0800

secure this thing

:040000 040000 40ee3e7821b895e52c1695092db9bdc4c61d1730 f24d3c6ebcfc639b1a3814550e62d60b8e68a8e4 M config

Page 449: Git 101 Presentation

$ git bisect start$ git bisect bad$ git bisect good 3acb4c2c6666ed6cb91cb0b983efe9d50cf8cfbeBisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo$ git bisect goodBisecting: 3 revisions left to test after this[b047b02ea83310a70fd603dc8cd7a6cd13d15c04] secure this thing$ git bisect badBisecting: 1 revisions left to test after this[f71ce38690acf49c1f3c9bea38e09d82a5ce6014] drop exceptions table$ git bisect goodb047b02ea83310a70fd603dc8cd7a6cd13d15c04 is first bad commitcommit b047b02ea83310a70fd603dc8cd7a6cd13d15c04Author: PJ Hyett <[email protected]>Date: Tue Jan 27 14:48:32 2009 -0800

secure this thing

:040000 040000 40ee3e7821b895e52c1695092db9bdc4c61d1730 f24d3c6ebcfc639b1a3814550e62d60b8e68a8e4 M config

Page 450: Git 101 Presentation

$ git bisect start$ git bisect bad$ git bisect good 3acb4c2c6666ed6cb91cb0b983efe9d50cf8cfbeBisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo$ git bisect goodBisecting: 3 revisions left to test after this[b047b02ea83310a70fd603dc8cd7a6cd13d15c04] secure this thing$ git bisect badBisecting: 1 revisions left to test after this[f71ce38690acf49c1f3c9bea38e09d82a5ce6014] drop exceptions table$ git bisect goodb047b02ea83310a70fd603dc8cd7a6cd13d15c04 is first bad commitcommit b047b02ea83310a70fd603dc8cd7a6cd13d15c04Author: PJ Hyett <[email protected]>Date: Tue Jan 27 14:48:32 2009 -0800

secure this thing

:040000 040000 40ee3e7821b895e52c1695092db9bdc4c61d1730 f24d3c6ebcfc639b1a3814550e62d60b8e68a8e4 M config

Page 451: Git 101 Presentation

$ git bisect start$ git bisect bad$ git bisect good 3acb4c2c6666ed6cb91cb0b983efe9d50cf8cfbeBisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo$ git bisect goodBisecting: 3 revisions left to test after this[b047b02ea83310a70fd603dc8cd7a6cd13d15c04] secure this thing$ git bisect badBisecting: 1 revisions left to test after this[f71ce38690acf49c1f3c9bea38e09d82a5ce6014] drop exceptions table$ git bisect goodb047b02ea83310a70fd603dc8cd7a6cd13d15c04 is first bad commitcommit b047b02ea83310a70fd603dc8cd7a6cd13d15c04Author: PJ Hyett <[email protected]>Date: Tue Jan 27 14:48:32 2009 -0800

secure this thing

:040000 040000 40ee3e7821b895e52c1695092db9bdc4c61d1730 f24d3c6ebcfc639b1a3814550e62d60b8e68a8e4 M config

Page 452: Git 101 Presentation

$ git bisect start$ git bisect bad$ git bisect good 3acb4c2c6666ed6cb91cb0b983efe9d50cf8cfbeBisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo$ git bisect goodBisecting: 3 revisions left to test after this[b047b02ea83310a70fd603dc8cd7a6cd13d15c04] secure this thing$ git bisect badBisecting: 1 revisions left to test after this[f71ce38690acf49c1f3c9bea38e09d82a5ce6014] drop exceptions table$ git bisect goodb047b02ea83310a70fd603dc8cd7a6cd13d15c04 is first bad commitcommit b047b02ea83310a70fd603dc8cd7a6cd13d15c04Author: PJ Hyett <[email protected]>Date: Tue Jan 27 14:48:32 2009 -0800

secure this thing

:040000 040000 40ee3e7821b895e52c1695092db9bdc4c61d1730 f24d3c6ebcfc639b1a3814550e62d60b8e68a8e4 M config

Page 453: Git 101 Presentation

$ git bisect reset

Page 454: Git 101 Presentation

no mas