Slide 1

Slide 1 text

Creating distributed development workflows using Git Susan Potter Champaign-Urbana Developer’s Meetup August 8, 2011

Slide 2

Slide 2 text

Scope of Talk • How does Git differ. . . ? CVS, Subversion, Perforce, Mercurial

Slide 3

Slide 3 text

Scope of Talk • How does Git differ. . . ? CVS, Subversion, Perforce, Mercurial • Gitting Started Locally Server configuration management

Slide 4

Slide 4 text

Scope of Talk • How does Git differ. . . ? CVS, Subversion, Perforce, Mercurial • Gitting Started Locally Server configuration management • Centralized Remote (a.k.a. a better Subversion)

Slide 5

Slide 5 text

Scope of Talk • How does Git differ. . . ? CVS, Subversion, Perforce, Mercurial • Gitting Started Locally Server configuration management • Centralized Remote (a.k.a. a better Subversion) • Forking Workflows (the GitHub model)

Slide 6

Slide 6 text

Scope of Talk • How does Git differ. . . ? CVS, Subversion, Perforce, Mercurial • Gitting Started Locally Server configuration management • Centralized Remote (a.k.a. a better Subversion) • Forking Workflows (the GitHub model) • Gatekeeper Workflows (enterprise release management)

Slide 7

Slide 7 text

Scope of Talk • How does Git differ. . . ? CVS, Subversion, Perforce, Mercurial • Gitting Started Locally Server configuration management • Centralized Remote (a.k.a. a better Subversion) • Forking Workflows (the GitHub model) • Gatekeeper Workflows (enterprise release management) • Deployment Strategies? (scalable distributed deployment)

Slide 8

Slide 8 text

VCS Dimensions Delta DAG Local RCS cp -r or hard links Centralized CVS, Subversion, Perforce ? Distributed Mercurial, Darcs Git, Bazaar

Slide 9

Slide 9 text

Gitting Started Locally (1/4) Initializing local repo inside working directory

Slide 10

Slide 10 text

Gitting Started Locally (1/4) Initializing local repo inside working directory • git init

Slide 11

Slide 11 text

Gitting Started Locally (1/4) Initializing local repo inside working directory • git init • git config user.email “user@domain”

Slide 12

Slide 12 text

Gitting Started Locally (1/4) Initializing local repo inside working directory • git init • git config user.email “user@domain” • git config user.name “Your Name”

Slide 13

Slide 13 text

Gitting Started Locally (2/4) $GIT_DIR => .git/

Slide 14

Slide 14 text

Gitting Started Locally (2/4) $GIT_DIR => .git/ • branches

Slide 15

Slide 15 text

Gitting Started Locally (2/4) $GIT_DIR => .git/ • branches • hooks

Slide 16

Slide 16 text

Gitting Started Locally (2/4) $GIT_DIR => .git/ • branches • hooks • objects

Slide 17

Slide 17 text

Gitting Started Locally (2/4) $GIT_DIR => .git/ • branches • hooks • objects • refs

Slide 18

Slide 18 text

Gitting Started Locally (2/4) $GIT_DIR => .git/ • branches • hooks • objects • refs • config & info

Slide 19

Slide 19 text

Gitting Started Locally (3/4) $GIT_INDEX => .git/index

Slide 20

Slide 20 text

Gitting Started Locally (3/4) $GIT_INDEX => .git/index • staging area

Slide 21

Slide 21 text

Gitting Started Locally (3/4) $GIT_INDEX => .git/index • staging area • add files before commit

Slide 22

Slide 22 text

Gitting Started Locally (3/4) $GIT_INDEX => .git/index • staging area • add files before commit • can even add “patches”

Slide 23

Slide 23 text

Gitting Started Locally (4/4) D E M O

Slide 24

Slide 24 text

Centralized Workflow (1/3) Adding a remote

Slide 25

Slide 25 text

Centralized Workflow (1/3) Adding a remote • git init bare Create remote “bare” repo

Slide 26

Slide 26 text

Centralized Workflow (1/3) Adding a remote • git init bare Create remote “bare” repo • Setup server authN/authZ e.g. $HOME/.ssh/authorized_keys, PAM, LDAP, etc.

Slide 27

Slide 27 text

Centralized Workflow (1/3) Adding a remote • git init bare Create remote “bare” repo • Setup server authN/authZ e.g. $HOME/.ssh/authorized_keys, PAM, LDAP, etc. • git remote add Add remote to local repository

Slide 28

Slide 28 text

Centralized Workflow (2/3) Sharing to remote

Slide 29

Slide 29 text

Centralized Workflow (2/3) Sharing to remote • git pull Pull from

Slide 30

Slide 30 text

Centralized Workflow (2/3) Sharing to remote • git pull Pull from • git push Push to

Slide 31

Slide 31 text

Centralized Workflow (3/3) D E M O (with branching)

Slide 32

Slide 32 text

Forking Workflow (1/2) Forking remote repository. . .

Slide 33

Slide 33 text

Forking Workflow (1/2) Forking remote repository. . . • cp -r Basically just a straight copy is necessary

Slide 34

Slide 34 text

Forking Workflow (2/2) D E M O

Slide 35

Slide 35 text

Gatekeeper Workflow (1/2) Gatekeeper remote repository. . .

Slide 36

Slide 36 text

Gatekeeper Workflow (1/2) Gatekeeper remote repository. . . • git init bare Basically just create a bare Git repo and let gatekeeper curate and selectively push

Slide 37

Slide 37 text

Gatekeeper Workflow (2/2) D E M O

Slide 38

Slide 38 text

Deployment Workflows (1/2) Distributed systems deployment could bundle rollback with new release. . .

Slide 39

Slide 39 text

Deployment Workflows (1/2) Distributed systems deployment could bundle rollback with new release. . . • git bundle create Creating a bundle with those branches, tags and/or commit range

Slide 40

Slide 40 text

Deployment Workflows (1/2) Distributed systems deployment could bundle rollback with new release. . . • git bundle create Creating a bundle with those branches, tags and/or commit range • git bundle verify Verify bundle is valid and will apply cleanly to deployed repository

Slide 41

Slide 41 text

Deployment Workflows (1/2) Distributed systems deployment could bundle rollback with new release. . . • git bundle create Creating a bundle with those branches, tags and/or commit range • git bundle verify Verify bundle is valid and will apply cleanly to deployed repository • git bundle unbundle Unbundling subset of repository on deployment node

Slide 42

Slide 42 text

Deployment Workflows (2/2) D E M O

Slide 43

Slide 43 text

Resources (1/2) • http://git-scm.org • http://github.com • Pro Git by Scott Chacon

Slide 44

Slide 44 text

Questions? Figure: http://www.flickr.com/photos/42682395@N04/

Slide 45

Slide 45 text

Questions? Figure: http://www.flickr.com/photos/42682395@N04/ @SusanPotter