23

Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

  • Upload
    others

  • View
    22

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Gita fast distributed revision control system

Eric Müller

UHEI

FACETS CodeJam #22008-05-06

Eric Müller Git FACETS CodeJam #2 2008-05-06 1 / 7

Page 2: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git

Features

distributed development model

gives each developer a local copy of the entire history⇒ disconnected operation

good support for non-linear development

lightweight & fast branchingeasy mergingprivate branches

cryptographic authentication of history (git-tag -s -m "Message")

easy access to svn/svk upstream repositories (git-svn)

cvsserver emulation

Now

internal structure of git

Eric Müller Git FACETS CodeJam #2 2008-05-06 2 / 7

Page 3: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git

Features

distributed development model

gives each developer a local copy of the entire history⇒ disconnected operation

good support for non-linear development

lightweight & fast branchingeasy mergingprivate branches

cryptographic authentication of history (git-tag -s -m "Message")

easy access to svn/svk upstream repositories (git-svn)

cvsserver emulation

Now

internal structure of git

Eric Müller Git FACETS CodeJam #2 2008-05-06 2 / 7

Page 4: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git

Features

distributed development model

gives each developer a local copy of the entire history⇒ disconnected operation

good support for non-linear development

lightweight & fast branchingeasy mergingprivate branches

cryptographic authentication of history (git-tag -s -m "Message")

easy access to svn/svk upstream repositories (git-svn)

cvsserver emulation

Now

internal structure of git

Eric Müller Git FACETS CodeJam #2 2008-05-06 2 / 7

Page 5: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � Basic ideas

Git manages a set of objects (revisions, �les, directories, . . . )

Each object is identi�ed by its SHA1 sum (e.g.4cdeed861b5f797b3fa661eb331a6bd6ad669c6a)

Objects can point to each other

Eric Müller Git FACETS CodeJam #2 2008-05-06 3 / 7

Page 6: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � A directed acyclic graph

Tag

points to a commitcontains an (optional cryptographicallysigned) message

tagname

Commit

contains a message and a tree objectpointers to ≥ 1 parent commitsbranchname gets updated (HEAD too)

Tree

collection of blobs with �lenames and(fs-) permissionsstate of a directory hierarchy at a givenrevision/time

Blob

chunk of binary data, i.e. contents of�les, symlinks, . . .identi�ed by SHA1 (160 bits) checksum

⇒ one blob per �le revisionEric Müller Git FACETS CodeJam #2 2008-05-06 4 / 7

Page 7: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � A directed acyclic graph

Tag

points to a commitcontains an (optional cryptographicallysigned) message

tagname

Commit

contains a message and a tree objectpointers to ≥ 1 parent commitsbranchname gets updated (HEAD too)

Tree

collection of blobs with �lenames and(fs-) permissionsstate of a directory hierarchy at a givenrevision/time

Blob

chunk of binary data, i.e. contents of�les, symlinks, . . .identi�ed by SHA1 (160 bits) checksum

⇒ one blob per �le revision

Eric Müller Git FACETS CodeJam #2 2008-05-06 4 / 7

Page 8: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � A directed acyclic graph

Tag

points to a commitcontains an (optional cryptographicallysigned) message

tagname

Commit

contains a message and a tree object

pointers to ≥ 1 parent commitsbranchname gets updated (HEAD too)

Tree

collection of blobs with �lenames and(fs-) permissionsstate of a directory hierarchy at a givenrevision/time

Blob

chunk of binary data, i.e. contents of�les, symlinks, . . .identi�ed by SHA1 (160 bits) checksum

⇒ one blob per �le revision

Eric Müller Git FACETS CodeJam #2 2008-05-06 4 / 7

Page 9: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � A directed acyclic graph

Tag

points to a commitcontains an (optional cryptographicallysigned) message

tagname

Commit

contains a message and a tree objectpointers to ≥ 1 parent commits

branchname gets updated (HEAD too)

Tree

collection of blobs with �lenames and(fs-) permissionsstate of a directory hierarchy at a givenrevision/time

Blob

chunk of binary data, i.e. contents of�les, symlinks, . . .identi�ed by SHA1 (160 bits) checksum

⇒ one blob per �le revision

Eric Müller Git FACETS CodeJam #2 2008-05-06 4 / 7

Page 10: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � A directed acyclic graph

Tag

points to a commitcontains an (optional cryptographicallysigned) message

tagname

Commit

contains a message and a tree objectpointers to ≥ 1 parent commitsbranchname gets updated (HEAD too)

Tree

collection of blobs with �lenames and(fs-) permissionsstate of a directory hierarchy at a givenrevision/time

Blob

chunk of binary data, i.e. contents of�les, symlinks, . . .identi�ed by SHA1 (160 bits) checksum

⇒ one blob per �le revision

Eric Müller Git FACETS CodeJam #2 2008-05-06 4 / 7

Page 11: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � A directed acyclic graph

Tag

points to a commitcontains an (optional cryptographicallysigned) message

tagname

Commit

contains a message and a tree objectpointers to ≥ 1 parent commitsbranchname gets updated (HEAD too)

Tree

collection of blobs with �lenames and(fs-) permissionsstate of a directory hierarchy at a givenrevision/time

Blob

chunk of binary data, i.e. contents of�les, symlinks, . . .identi�ed by SHA1 (160 bits) checksum

⇒ one blob per �le revision

Eric Müller Git FACETS CodeJam #2 2008-05-06 4 / 7

Page 12: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � A directed acyclic graph

Tag

points to a commitcontains an (optional cryptographicallysigned) messagetagname

Commit

contains a message and a tree objectpointers to ≥ 1 parent commitsbranchname gets updated (HEAD too)

Tree

collection of blobs with �lenames and(fs-) permissionsstate of a directory hierarchy at a givenrevision/time

Blob

chunk of binary data, i.e. contents of�les, symlinks, . . .identi�ed by SHA1 (160 bits) checksum

⇒ one blob per �le revision

Eric Müller Git FACETS CodeJam #2 2008-05-06 4 / 7

Page 13: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � History

1 remote repository @ revision a

2 adding a local commit mya intolocal mybranch based on a

3 some remote commits

4 merging remote commits intomybranch

5 another remote commit

6 another merge from remote intolocal branch

7 another remote commit

more features

#parents ≥ 2 and successivemerging is possible

instead of merging, rewriting history(rebasing) is also possible

Eric Müller Git FACETS CodeJam #2 2008-05-06 5 / 7

Page 14: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � History

1 remote repository @ revision a

2 adding a local commit mya intolocal mybranch based on a

3 some remote commits

4 merging remote commits intomybranch

5 another remote commit

6 another merge from remote intolocal branch

7 another remote commit

more features

#parents ≥ 2 and successivemerging is possible

instead of merging, rewriting history(rebasing) is also possible

Eric Müller Git FACETS CodeJam #2 2008-05-06 5 / 7

Page 15: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � History

1 remote repository @ revision a

2 adding a local commit mya intolocal mybranch based on a

3 some remote commits

4 merging remote commits intomybranch

5 another remote commit

6 another merge from remote intolocal branch

7 another remote commit

more features

#parents ≥ 2 and successivemerging is possible

instead of merging, rewriting history(rebasing) is also possible

Eric Müller Git FACETS CodeJam #2 2008-05-06 5 / 7

Page 16: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � History

1 remote repository @ revision a

2 adding a local commit mya intolocal mybranch based on a

3 some remote commits

4 merging remote commits intomybranch

5 another remote commit

6 another merge from remote intolocal branch

7 another remote commit

more features

#parents ≥ 2 and successivemerging is possible

instead of merging, rewriting history(rebasing) is also possible

Eric Müller Git FACETS CodeJam #2 2008-05-06 5 / 7

Page 17: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � History

1 remote repository @ revision a

2 adding a local commit mya intolocal mybranch based on a

3 some remote commits

4 merging remote commits intomybranch

5 another remote commit

6 another merge from remote intolocal branch

7 another remote commit

more features

#parents ≥ 2 and successivemerging is possible

instead of merging, rewriting history(rebasing) is also possible

Eric Müller Git FACETS CodeJam #2 2008-05-06 5 / 7

Page 18: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � History

1 remote repository @ revision a

2 adding a local commit mya intolocal mybranch based on a

3 some remote commits

4 merging remote commits intomybranch

5 another remote commit

6 another merge from remote intolocal branch

7 another remote commit

more features

#parents ≥ 2 and successivemerging is possible

instead of merging, rewriting history(rebasing) is also possible

Eric Müller Git FACETS CodeJam #2 2008-05-06 5 / 7

Page 19: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � History

1 remote repository @ revision a

2 adding a local commit mya intolocal mybranch based on a

3 some remote commits

4 merging remote commits intomybranch

5 another remote commit

6 another merge from remote intolocal branch

7 another remote commit

more features

#parents ≥ 2 and successivemerging is possible

instead of merging, rewriting history(rebasing) is also possible

Eric Müller Git FACETS CodeJam #2 2008-05-06 5 / 7

Page 20: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Git � History

1 remote repository @ revision a

2 adding a local commit mya intolocal mybranch based on a

3 some remote commits

4 merging remote commits intomybranch

5 another remote commit

6 another merge from remote intolocal branch

7 another remote commit

more features

#parents ≥ 2 and successivemerging is possible

instead of merging, rewriting history(rebasing) is also possible

Eric Müller Git FACETS CodeJam #2 2008-05-06 5 / 7

Page 21: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Using Git

Integration

VIM: vcscommandhttp://code.google.com/p/vcscommand/

Trac: GitPluginhttp://trac-hacks.org/wiki/GitPlugin

Emacs: git.el (DVC is better?)http://www.emacswiki.org/cgi-bin/wiki/Git

Eclipse: J/EGIThttp://git.or.cz/gitwiki/EclipsePlugin

Information

Git � SVN Crash Coursehttp://git.or.cz/course/svn.html

Git cheat sheet, extended editionhttp://jan-krueger.net/development/

git-cheat-sheet-extended-edition

Eric Müller Git FACETS CodeJam #2 2008-05-06 6 / 7

Page 22: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

Using Git

Integration

VIM: vcscommandhttp://code.google.com/p/vcscommand/

Trac: GitPluginhttp://trac-hacks.org/wiki/GitPlugin

Emacs: git.el (DVC is better?)http://www.emacswiki.org/cgi-bin/wiki/Git

Eclipse: J/EGIThttp://git.or.cz/gitwiki/EclipsePlugin

Information

Git � SVN Crash Coursehttp://git.or.cz/course/svn.html

Git cheat sheet, extended editionhttp://jan-krueger.net/development/

git-cheat-sheet-extended-edition

Eric Müller Git FACETS CodeJam #2 2008-05-06 6 / 7

Page 23: Git - a fast distributed revision control systemneuralensemble.org/media/slides/CodeJam2_Mueller_Git.pdf · Git Features distributed development model gives each developer a local

References

good documentation (manpages, user- & developer tutorials)

The guts of githttp://lwn.net/Articles/131657/

Git for Computer Scientistshttp://eagain.net/articles/git-for-computer-scientists/

Eric Müller Git FACETS CodeJam #2 2008-05-06 7 / 7