an introduction to git Ewen Cheslack-Postava 1 Outline Review of - - PDF document

an introduction to git
SMART_READER_LITE
LIVE PREVIEW

an introduction to git Ewen Cheslack-Postava 1 Outline Review of - - PDF document

an introduction to git Ewen Cheslack-Postava 1 Outline Review of Version Control Distributed Version Control Repository Model Working Locally Workflows Additional Resources 2 Version Control Basics Developer chooses


slide-1
SLIDE 1

an introduction to git

Ewen Cheslack-Postava

1

slide-2
SLIDE 2

Outline

  • Review of Version Control
  • Distributed Version Control
  • Repository Model
  • Working Locally
  • Workflows
  • Additional Resources

2

slide-3
SLIDE 3

Version Control Basics

  • Developer chooses checkpoints
  • VCS provides atomic commits
  • And method to exchange them
  • Handles conflicts
  • Other developer committed to same file

before you

3

slide-4
SLIDE 4

Version Control Basics

  • Simple, linear model

VCS

master

4

slide-5
SLIDE 5

Version Control Basics

  • Branching model
  • Parallel development
  • Bug fixes vs. next release
  • Merges reconnect branch

and master

VCS

master branch

5

slide-6
SLIDE 6

Version Control Basics

  • Useful even for single developer!
  • Attach messages to commits to indicate

what was done and why

  • Manage work on multiple features using

branches

  • Binary search to find bug-causing commit

6

slide-7
SLIDE 7

Centralized VCS

  • Repository is centralized
  • Most operations interact with server
  • Examples: CVS, SVN
  • In practice:
  • Branching is a copy
  • Merging isn’t handled well
  • These are getting better (see newest svn)

7

slide-8
SLIDE 8

How does git differ?

  • ... or Arch?
  • ... or Monotone?
  • ... or Darcs?
  • ... or Hg?
  • ... or Bazaar?

8

So how does git difger from the “standard” centralized model of revision control? Actually, git isn’t particularly special -- we could ask the same of Arch, Monotone, etc. All of these are distributed revision control systems or DVCS. While they are difgerent, they all share common core concepts.

slide-9
SLIDE 9

How do DVCS differ?

9

slide-10
SLIDE 10

How do DVCS differ?

  • No checkouts, only repositories

9

slide-11
SLIDE 11

How do DVCS differ?

  • No checkouts, only repositories
  • Avoid network except to sync

9

slide-12
SLIDE 12

How do DVCS differ?

  • No checkouts, only repositories
  • Avoid network except to sync
  • Encourage branching - cheap, local

9

slide-13
SLIDE 13

How do DVCS differ?

  • No checkouts, only repositories
  • Avoid network except to sync
  • Encourage branching - cheap, local
  • Better merge (usually)

9

slide-14
SLIDE 14

Repository Model

  • Graph of commits - hash of

content

  • Edges are patches
  • Only branches, no “trunk”
  • Default master branch, not

special

  • GC using branch HEADs and

tags (a.k.a. refs)

local

master branch

P1 P2 P3

10

slide-15
SLIDE 15

Local - Cloning

project/

11

The basic workflow with DVCS is both similar and difgerent from normal VCS. Instead of checking out a current revision, you clone the entire repository. Every revision ever checked in, and all branches and tags, will be copied locally to your machine (in the .git directory). A “checkout” now is just getting a certain copy into the working directory so you can edit it, but it always comes from local files.

slide-16
SLIDE 16

Local - Cloning

project/ .git/

  • Don’t checkout, instead clone
  • git clone git://user@server/repo.git

[dest]

  • Complete copy of repository

11

The basic workflow with DVCS is both similar and difgerent from normal VCS. Instead of checking out a current revision, you clone the entire repository. Every revision ever checked in, and all branches and tags, will be copied locally to your machine (in the .git directory). A “checkout” now is just getting a certain copy into the working directory so you can edit it, but it always comes from local files.

slide-17
SLIDE 17

Local - Cloning

project/ .git/ d1/ d2/ f1 f2

  • Checkout gets a working version
  • git checkout master
  • Don’t checkout, instead clone
  • git clone git://user@server/repo.git

[dest]

  • Complete copy of repository

11

The basic workflow with DVCS is both similar and difgerent from normal VCS. Instead of checking out a current revision, you clone the entire repository. Every revision ever checked in, and all branches and tags, will be copied locally to your machine (in the .git directory). A “checkout” now is just getting a certain copy into the working directory so you can edit it, but it always comes from local files.

slide-18
SLIDE 18

Local - Commits

local

HEAD

12

In git, and other DVCS, commits are local. This means that they only afgect your local

  • repository. Git is a bit odd in that it requires you to add and then commit files. This gives

you finer granularity when selecting what to commit. There’s even a mode where you can select parts of patches to files to add called “interactive add.” Adding files puts those changes in the “staging area.” The staging area is used in a number

  • f commands as temporary storage before completing an operation. You can think of it like

an in-progress commit. While the changes are there, they are trivial to back out, but you also won’t lose them by editing files. Finally, you can commit. I’ve specified a message on the command line, and git will always prompt you for a commit message. If you don’t put a descriptive commit message, your developer friends won’t like you.

slide-19
SLIDE 19

Local - Commits

  • Commits are local

local

HEAD

12

In git, and other DVCS, commits are local. This means that they only afgect your local

  • repository. Git is a bit odd in that it requires you to add and then commit files. This gives

you finer granularity when selecting what to commit. There’s even a mode where you can select parts of patches to files to add called “interactive add.” Adding files puts those changes in the “staging area.” The staging area is used in a number

  • f commands as temporary storage before completing an operation. You can think of it like

an in-progress commit. While the changes are there, they are trivial to back out, but you also won’t lose them by editing files. Finally, you can commit. I’ve specified a message on the command line, and git will always prompt you for a commit message. If you don’t put a descriptive commit message, your developer friends won’t like you.

slide-20
SLIDE 20

Local - Commits

  • Commits are local
  • Add files or changes
  • git add file1 file2
  • Staging area

local

HEAD

12

In git, and other DVCS, commits are local. This means that they only afgect your local

  • repository. Git is a bit odd in that it requires you to add and then commit files. This gives

you finer granularity when selecting what to commit. There’s even a mode where you can select parts of patches to files to add called “interactive add.” Adding files puts those changes in the “staging area.” The staging area is used in a number

  • f commands as temporary storage before completing an operation. You can think of it like

an in-progress commit. While the changes are there, they are trivial to back out, but you also won’t lose them by editing files. Finally, you can commit. I’ve specified a message on the command line, and git will always prompt you for a commit message. If you don’t put a descriptive commit message, your developer friends won’t like you.

slide-21
SLIDE 21

Local - Commits

  • Commits are local
  • Add files or changes
  • git add file1 file2
  • Staging area

local

HEAD Staging

12

In git, and other DVCS, commits are local. This means that they only afgect your local

  • repository. Git is a bit odd in that it requires you to add and then commit files. This gives

you finer granularity when selecting what to commit. There’s even a mode where you can select parts of patches to files to add called “interactive add.” Adding files puts those changes in the “staging area.” The staging area is used in a number

  • f commands as temporary storage before completing an operation. You can think of it like

an in-progress commit. While the changes are there, they are trivial to back out, but you also won’t lose them by editing files. Finally, you can commit. I’ve specified a message on the command line, and git will always prompt you for a commit message. If you don’t put a descriptive commit message, your developer friends won’t like you.

slide-22
SLIDE 22

Local - Commits

  • Commits are local
  • Add files or changes
  • git add file1 file2
  • Staging area
  • Commit
  • git commit -m “Useful commit message.”

local

HEAD Staging

12

In git, and other DVCS, commits are local. This means that they only afgect your local

  • repository. Git is a bit odd in that it requires you to add and then commit files. This gives

you finer granularity when selecting what to commit. There’s even a mode where you can select parts of patches to files to add called “interactive add.” Adding files puts those changes in the “staging area.” The staging area is used in a number

  • f commands as temporary storage before completing an operation. You can think of it like

an in-progress commit. While the changes are there, they are trivial to back out, but you also won’t lose them by editing files. Finally, you can commit. I’ve specified a message on the command line, and git will always prompt you for a commit message. If you don’t put a descriptive commit message, your developer friends won’t like you.

slide-23
SLIDE 23

Local - Commits

  • Commits are local
  • Add files or changes
  • git add file1 file2
  • Staging area
  • Commit
  • git commit -m “Useful commit message.”

local

HEAD

12

In git, and other DVCS, commits are local. This means that they only afgect your local

  • repository. Git is a bit odd in that it requires you to add and then commit files. This gives

you finer granularity when selecting what to commit. There’s even a mode where you can select parts of patches to files to add called “interactive add.” Adding files puts those changes in the “staging area.” The staging area is used in a number

  • f commands as temporary storage before completing an operation. You can think of it like

an in-progress commit. While the changes are there, they are trivial to back out, but you also won’t lose them by editing files. Finally, you can commit. I’ve specified a message on the command line, and git will always prompt you for a commit message. If you don’t put a descriptive commit message, your developer friends won’t like you.

slide-24
SLIDE 24

Local - Blame

  • Blame - who committed this obviously

broken code? Line-by-line committer

  • git blame file

3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 144) // 1. If the source is the space, somebody is messing with us. 0facfde9 (Daniel Reiter Horn 2009-12-15 17:26:46 -0800 145) bool space_source = (front.obj_msg->source_object() == UUID::null()); 3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 146) if (space_source) { 3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 147) SILOG(cbr,error,"Got message from object host claiming to be from space."); 0facfde9 (Daniel Reiter Horn 2009-12-15 17:26:46 -0800 148) delete front.obj_msg; 3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 149) return; 3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 150) } 3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 151) 3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 152) // 2. For connection bootstrapping purposes we need to exempt session messages destined for the space. 3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 153) // Note that we need to check this before the connected sanity check since obviously the object won't 3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 154) // be connected yet. We dispatch directly from here since this needs information about the object host 3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 155) // connection to be passed along as well. 0facfde9 (Daniel Reiter Horn 2009-12-15 17:26:46 -0800 156) bool space_dest = (front.obj_msg->dest_object() == UUID::null()); 0facfde9 (Daniel Reiter Horn 2009-12-15 17:26:46 -0800 157) bool session_msg = (front.obj_msg->dest_port() == OBJECT_PORT_SESSION); 78b38d90 (behram mistree 2009-09-14 15:27:42 -0700 158) if (space_dest && session_msg) 78b38d90 (behram mistree 2009-09-14 15:27:42 -0700 159) { 0facfde9 (Daniel Reiter Horn 2009-12-15 17:26:46 -0800 160) handleSessionMessage(front.conn_id, front.obj_msg); 3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 161) return; 3aa995bb (Ewen Cheslack-Postava 2009-09-04 15:16:11 -0700 162) } 5abdef87 (Ewen Cheslack-Postava 2009-09-10 13:25:48 -0700 163)

13

Two handy commands you can now use locally are blame and bisect. Blame tells you who committed each line.

slide-25
SLIDE 25

Local - Bisect

local

A B D C

14

Bisect helps you determine which commit broke some functionality to help you track the cause of the bug. Neither of these are unique to git or DVCS, but they are easier when you have everything available locally.

slide-26
SLIDE 26

Local - Bisect

  • Bisect - which commit

caused the error

local

A B D C

14

Bisect helps you determine which commit broke some functionality to help you track the cause of the bug. Neither of these are unique to git or DVCS, but they are easier when you have everything available locally.

slide-27
SLIDE 27

Local - Bisect

  • Bisect - which commit

caused the error

  • git bisect start

local

A B D C

14

Bisect helps you determine which commit broke some functionality to help you track the cause of the bug. Neither of these are unique to git or DVCS, but they are easier when you have everything available locally.

slide-28
SLIDE 28

Local - Bisect

  • Bisect - which commit

caused the error

  • git bisect start
  • git bisect bad [rev]

local

A B D C

14

Bisect helps you determine which commit broke some functionality to help you track the cause of the bug. Neither of these are unique to git or DVCS, but they are easier when you have everything available locally.

slide-29
SLIDE 29

Local - Bisect

  • Bisect - which commit

caused the error

  • git bisect start
  • git bisect bad [rev]

local

A B D C

bad

14

Bisect helps you determine which commit broke some functionality to help you track the cause of the bug. Neither of these are unique to git or DVCS, but they are easier when you have everything available locally.

slide-30
SLIDE 30

Local - Bisect

  • Bisect - which commit

caused the error

  • git bisect start
  • git bisect bad [rev]
  • git bisect good [rev]

local

A B D C

bad

14

Bisect helps you determine which commit broke some functionality to help you track the cause of the bug. Neither of these are unique to git or DVCS, but they are easier when you have everything available locally.

slide-31
SLIDE 31

Local - Bisect

  • Bisect - which commit

caused the error

  • git bisect start
  • git bisect bad [rev]
  • git bisect good [rev]

local

A B D C

good bad

14

Bisect helps you determine which commit broke some functionality to help you track the cause of the bug. Neither of these are unique to git or DVCS, but they are easier when you have everything available locally.

slide-32
SLIDE 32

Local - Bisect

  • Bisect - which commit

caused the error

  • git bisect start
  • git bisect bad [rev]
  • git bisect good [rev]

local

A B D C

good bad bad

14

Bisect helps you determine which commit broke some functionality to help you track the cause of the bug. Neither of these are unique to git or DVCS, but they are easier when you have everything available locally.

slide-33
SLIDE 33

Local - Bisect

  • Bisect - which commit

caused the error

  • git bisect start
  • git bisect bad [rev]
  • git bisect good [rev]

local

A B D C

good bad bad good

14

Bisect helps you determine which commit broke some functionality to help you track the cause of the bug. Neither of these are unique to git or DVCS, but they are easier when you have everything available locally.

slide-34
SLIDE 34

Local - Branches

local

master

15

slide-35
SLIDE 35

Local - Branches

  • Full repository - create

branches locally

  • git branch bname [start]

local

master

15

slide-36
SLIDE 36

Local - Branches

  • Full repository - create

branches locally

  • git branch bname [start]

local

master branch

15

slide-37
SLIDE 37

Local - Branches

  • Full repository - create

branches locally

  • git branch bname [start]
  • Work on a branch
  • git checkout bname

local

master branch

15

slide-38
SLIDE 38

Local - Branches

  • Full repository - create

branches locally

  • git branch bname [start]
  • Work on a branch
  • git checkout bname
  • Commit
  • git commit -a -m “Feature.”

local

master branch

15

slide-39
SLIDE 39

Local - Branches

  • Full repository - create

branches locally

  • git branch bname [start]
  • Work on a branch
  • git checkout bname
  • Commit
  • git commit -a -m “Feature.”

local

master branch

15

slide-40
SLIDE 40

Local - Branches

  • Full repository - create

branches locally

  • git branch bname [start]
  • Work on a branch
  • git checkout bname
  • Commit
  • git commit -a -m “Feature.”

local

branch master

15

slide-41
SLIDE 41

Local - Merging

  • Merge branch into master
  • git checkout master
  • git merge branch
  • Intelligent - knows branch

point, works with patch graph

  • Merge failure prompts to

fix conflicts

local

master branch

16

slide-42
SLIDE 42

Local - Merging

  • Merge branch into master
  • git checkout master
  • git merge branch
  • Intelligent - knows branch

point, works with patch graph

  • Merge failure prompts to

fix conflicts

local

branch master

16

slide-43
SLIDE 43

Local - Rebasing

  • “Cut and paste” a branch
  • nto another
  • git rebase onto [source]
  • Apply patches in order
  • Use onto as new branch

point

  • Prompt on patch failure

local

A B

master

D C

branch

E

17

slide-44
SLIDE 44

Local - Rebasing

  • “Cut and paste” a branch
  • nto another
  • git rebase onto [source]
  • Apply patches in order
  • Use onto as new branch

point

  • Prompt on patch failure

local

A B

master

D’ C

branch

E’

18

slide-45
SLIDE 45

Interactive Rebasing

  • Interactive mode lets you “refactor” commits
  • pick - use the commit as is
  • squash - combine with previous
  • edit - stop during rebase to edit files or

commit message

  • Get list in editor; rearrange; remove commits;

set command on each patch

  • I find normal rebase followed by interactive to

refactor is easiest

19

slide-46
SLIDE 46

Merge vs. Rebase

  • Rebasing
  • Keeps a linear history
  • Rewrite history - untested commits!
  • Use for: short-term conflicts
  • Merging
  • Adds merge commit
  • Maintains parallel history
  • Use for: long term parallel development

20

slide-47
SLIDE 47

Workflows - Sharing

  • rigin

(user@server:repo.git) local

21

Of course we still want to be able to exchange updates or new revisions, and we do that by

  • syncing. In git this is called pushing and pulling. In both, we specify the remote server, and
  • ptionally the source and destination branches. We’ll get to branches soon. In this example

we have a remote called origin, which is just shorthand for a server and account. Of course, we can always follow the really old-fashioned approach and get patches from git which we can then email. Git has very nice support for this because a lot of kernel development is done this way. Ideally you shouldn’t be using this, so we won’t cover it.

slide-48
SLIDE 48

Workflows - Sharing

  • Sync between repositories
  • rigin

(user@server:repo.git) local

21

Of course we still want to be able to exchange updates or new revisions, and we do that by

  • syncing. In git this is called pushing and pulling. In both, we specify the remote server, and
  • ptionally the source and destination branches. We’ll get to branches soon. In this example

we have a remote called origin, which is just shorthand for a server and account. Of course, we can always follow the really old-fashioned approach and get patches from git which we can then email. Git has very nice support for this because a lot of kernel development is done this way. Ideally you shouldn’t be using this, so we won’t cover it.

slide-49
SLIDE 49

Workflows - Sharing

  • Sync between repositories
  • git pull origin [src:dest]
  • rigin

(user@server:repo.git) local

21

Of course we still want to be able to exchange updates or new revisions, and we do that by

  • syncing. In git this is called pushing and pulling. In both, we specify the remote server, and
  • ptionally the source and destination branches. We’ll get to branches soon. In this example

we have a remote called origin, which is just shorthand for a server and account. Of course, we can always follow the really old-fashioned approach and get patches from git which we can then email. Git has very nice support for this because a lot of kernel development is done this way. Ideally you shouldn’t be using this, so we won’t cover it.

slide-50
SLIDE 50

Workflows - Sharing

  • Sync between repositories
  • git pull origin [src:dest]
  • rigin

(user@server:repo.git) local

21

Of course we still want to be able to exchange updates or new revisions, and we do that by

  • syncing. In git this is called pushing and pulling. In both, we specify the remote server, and
  • ptionally the source and destination branches. We’ll get to branches soon. In this example

we have a remote called origin, which is just shorthand for a server and account. Of course, we can always follow the really old-fashioned approach and get patches from git which we can then email. Git has very nice support for this because a lot of kernel development is done this way. Ideally you shouldn’t be using this, so we won’t cover it.

slide-51
SLIDE 51

Workflows - Sharing

  • Sync between repositories
  • git pull origin [src:dest]
  • git push origin [src:dest]
  • rigin

(user@server:repo.git) local

21

Of course we still want to be able to exchange updates or new revisions, and we do that by

  • syncing. In git this is called pushing and pulling. In both, we specify the remote server, and
  • ptionally the source and destination branches. We’ll get to branches soon. In this example

we have a remote called origin, which is just shorthand for a server and account. Of course, we can always follow the really old-fashioned approach and get patches from git which we can then email. Git has very nice support for this because a lot of kernel development is done this way. Ideally you shouldn’t be using this, so we won’t cover it.

slide-52
SLIDE 52

Workflows - Sharing

  • Sync between repositories
  • git pull origin [src:dest]
  • git push origin [src:dest]
  • rigin

(user@server:repo.git) local

21

Of course we still want to be able to exchange updates or new revisions, and we do that by

  • syncing. In git this is called pushing and pulling. In both, we specify the remote server, and
  • ptionally the source and destination branches. We’ll get to branches soon. In this example

we have a remote called origin, which is just shorthand for a server and account. Of course, we can always follow the really old-fashioned approach and get patches from git which we can then email. Git has very nice support for this because a lot of kernel development is done this way. Ideally you shouldn’t be using this, so we won’t cover it.

slide-53
SLIDE 53

Workflows - Sharing

  • Sync between repositories
  • git pull origin [src:dest]
  • git push origin [src:dest]
  • rigin

(user@server:repo.git) local

21

Of course we still want to be able to exchange updates or new revisions, and we do that by

  • syncing. In git this is called pushing and pulling. In both, we specify the remote server, and
  • ptionally the source and destination branches. We’ll get to branches soon. In this example

we have a remote called origin, which is just shorthand for a server and account. Of course, we can always follow the really old-fashioned approach and get patches from git which we can then email. Git has very nice support for this because a lot of kernel development is done this way. Ideally you shouldn’t be using this, so we won’t cover it.

slide-54
SLIDE 54

Workflows - Sharing

  • Sync between repositories
  • git pull origin [src:dest]
  • git push origin [src:dest]
  • Or just ship patch[sets]
  • rigin

(user@server:repo.git) local

21

Of course we still want to be able to exchange updates or new revisions, and we do that by

  • syncing. In git this is called pushing and pulling. In both, we specify the remote server, and
  • ptionally the source and destination branches. We’ll get to branches soon. In this example

we have a remote called origin, which is just shorthand for a server and account. Of course, we can always follow the really old-fashioned approach and get patches from git which we can then email. Git has very nice support for this because a lot of kernel development is done this way. Ideally you shouldn’t be using this, so we won’t cover it.

slide-55
SLIDE 55

Workflows - Sharing

  • Sync between repositories
  • git pull origin [src:dest]
  • git push origin [src:dest]
  • Or just ship patch[sets]
  • git-format-patch, git-am
  • rigin

(user@server:repo.git) local

21

Of course we still want to be able to exchange updates or new revisions, and we do that by

  • syncing. In git this is called pushing and pulling. In both, we specify the remote server, and
  • ptionally the source and destination branches. We’ll get to branches soon. In this example

we have a remote called origin, which is just shorthand for a server and account. Of course, we can always follow the really old-fashioned approach and get patches from git which we can then email. Git has very nice support for this because a lot of kernel development is done this way. Ideally you shouldn’t be using this, so we won’t cover it.

slide-56
SLIDE 56

Workflows - Centralized

  • Blessed repository
  • Centralized, account

per committer

  • Push/pull equivalent to

commit/update

blessed c1 c2 c3 c4

22

Ok, so we know how to make changes, push and pull between repositories, but then how do we actually work with others? Well, let’s cover the centralized style first since its one of the easier approaches, and still quite common. In this model, there is a blessed, centralized repository. All committers need to write access, i.e. accounts to the repository on its server. Each committer clones that repository and simply pulls/pushes to it. No communication occurs between committer

  • repositories. This ends up being essentially equivalent to svn commit and update except that

more than one commit can occur in a push/pull.

slide-57
SLIDE 57

Workflows - Lieutenants

  • Blessed dictator

repository

  • Pull up
  • Dictator pulls from

lieutenants

  • Lieutenants pull from

contributors

dictator L1 L2 L3 L4 c1 c2 c3 c4

23

We can extend this model a bit to get a more scalable solution. We still have a blessed centralized repository which most people use. This is “the project.” We efgectively have 1 committer (or maybe lieutenants can also commit directly). The dictator pulls from

  • lieutenants. The lieutenants, however, may pull from anybody to get patches into the project.

This isn’t too difgerent except we’ve really flipped the arrows -- instead of pushing into the blessed repository, we flip things around and pull into the blessed repository. This is top- down instead of bottom-up.

slide-58
SLIDE 58

Workflows - Distributed

  • Repositories aren’t

special

  • Push/pull from

anybody

  • In practice, centralized

repositories emerge

c1 c2 c3 c4

24

The distributed workflow doesn’t treat any repository as special. This is the bazaar model. In practice this never happens. Somebody is a leader and their repository is de-facto special. But it is only de facto since everybody can get that repository and try to get people to work against theirs. Note that this model is always possible, the previous models are really just policies we apply on the distributed version control model for our own sanity.

slide-59
SLIDE 59

Other nice benefits

  • Fault tolerance
  • Entire history of Linux kernel is cloned in

thousands of locations

  • Private work, rebase to make it look pretty
  • Can do most work without hitting the

network

  • When on network, usually faster (less

chatty)

25

slide-60
SLIDE 60

Not a panacea

  • Large files can be a problem
  • Large initial clone
  • Or need to prune history for efficiency
  • Private sharing can be a pain (auth)
  • Often forces centralized model
  • Or let somebody else do it (e.g. Github)

26

slide-61
SLIDE 61

Additional Resources

  • Git Homepage [http://git-scm.com/]
  • Github [http://www.github.com/]
  • GitReady [http://www.gitready.com/]
  • Git for Computer Scientists

[http://eagain.net/articles/git-for-computer-scientists/]

27