distributed developer workflows using git

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

Upload: susan-potter

Post on 12-May-2015

2.553 views

Category:

Technology


0 download

DESCRIPTION

This meetup I will be walking the audience through how to setup, configure and maintain distributed development workflows using Git (the distributed VCS developers either love or hate). Much of the workflows suggested here will be applicable to other dVCSes like Mercurial, Darcs and Bazaar.

TRANSCRIPT

Page 1: Distributed Developer Workflows using Git

Creating distributed development workflows using Git

Susan Potter

Champaign-Urbana Developer’s Meetup

August 8, 2011

Page 2: Distributed Developer Workflows using Git

Scope of Talk

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

• Gitting Started LocallyServer 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)

Page 3: Distributed Developer Workflows using Git

Scope of Talk

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

• Gitting Started LocallyServer 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)

Page 4: Distributed Developer Workflows using Git

Scope of Talk

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

• Gitting Started LocallyServer 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)

Page 5: Distributed Developer Workflows using Git

Scope of Talk

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

• Gitting Started LocallyServer 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)

Page 6: Distributed Developer Workflows using Git

Scope of Talk

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

• Gitting Started LocallyServer 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)

Page 7: Distributed Developer Workflows using Git

Scope of Talk

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

• Gitting Started LocallyServer 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)

Page 8: Distributed Developer Workflows using Git

VCS Dimensions

Delta DAG

Local RCS cp -r or hard links

Centralized CVS, Subversion, Perforce ?

Distributed Mercurial, Darcs Git, Bazaar

Page 9: Distributed Developer Workflows using Git

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”

Page 10: Distributed Developer Workflows using Git

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”

Page 11: Distributed Developer Workflows using Git

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”

Page 12: Distributed Developer Workflows using Git

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”

Page 13: Distributed Developer Workflows using Git

Gitting Started Locally (2/4)

$GIT_DIR => .git/

• branches• hooks• objects• refs• config & info

Page 14: Distributed Developer Workflows using Git

Gitting Started Locally (2/4)

$GIT_DIR => .git/• branches

• hooks• objects• refs• config & info

Page 15: Distributed Developer Workflows using Git

Gitting Started Locally (2/4)

$GIT_DIR => .git/• branches• hooks

• objects• refs• config & info

Page 16: Distributed Developer Workflows using Git

Gitting Started Locally (2/4)

$GIT_DIR => .git/• branches• hooks• objects

• refs• config & info

Page 17: Distributed Developer Workflows using Git

Gitting Started Locally (2/4)

$GIT_DIR => .git/• branches• hooks• objects• refs

• config & info

Page 18: Distributed Developer Workflows using Git

Gitting Started Locally (2/4)

$GIT_DIR => .git/• branches• hooks• objects• refs• config & info

Page 19: Distributed Developer Workflows using Git

Gitting Started Locally (3/4)

$GIT_INDEX => .git/index

• staging area• add files before commit• can even add “patches”

Page 20: Distributed Developer Workflows using Git

Gitting Started Locally (3/4)

$GIT_INDEX => .git/index

• staging area

• add files before commit• can even add “patches”

Page 21: Distributed Developer Workflows using Git

Gitting Started Locally (3/4)

$GIT_INDEX => .git/index

• staging area• add files before commit

• can even add “patches”

Page 22: Distributed Developer Workflows using Git

Gitting Started Locally (3/4)

$GIT_INDEX => .git/index

• staging area• add files before commit• can even add “patches”

Page 23: Distributed Developer Workflows using Git

Gitting Started Locally (4/4)

D E M O

Page 24: Distributed Developer Workflows using Git

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 <name> <URL>

Add remote to local repository

Page 25: Distributed Developer Workflows using Git

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 <name> <URL>

Add remote to local repository

Page 26: Distributed Developer Workflows using Git

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 <name> <URL>

Add remote to local repository

Page 27: Distributed Developer Workflows using Git

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 <name> <URL>

Add remote to local repository

Page 28: Distributed Developer Workflows using Git

Centralized Workflow (2/3)

Sharing to remote

• git pull <remove> <branch>

Pull from <remote> <branch>

• git push <remote> <branch>

Push to <remote> <branch>

Page 29: Distributed Developer Workflows using Git

Centralized Workflow (2/3)

Sharing to remote• git pull <remove> <branch>

Pull from <remote> <branch>

• git push <remote> <branch>

Push to <remote> <branch>

Page 30: Distributed Developer Workflows using Git

Centralized Workflow (2/3)

Sharing to remote• git pull <remove> <branch>

Pull from <remote> <branch>

• git push <remote> <branch>

Push to <remote> <branch>

Page 31: Distributed Developer Workflows using Git

Centralized Workflow (3/3)

D E M O(with branching)

Page 32: Distributed Developer Workflows using Git

Forking Workflow (1/2)

Forking remote repository. . .

• cp -r <orig.repo> <forked.repo>

Basically just a straight copy is necessary

Page 33: Distributed Developer Workflows using Git

Forking Workflow (1/2)

Forking remote repository. . .• cp -r <orig.repo> <forked.repo>

Basically just a straight copy is necessary

Page 34: Distributed Developer Workflows using Git

Forking Workflow (2/2)

D E M O

Page 35: Distributed Developer Workflows using Git

Gatekeeper Workflow (1/2)

Gatekeeper remote repository. . .

• git init �bare

Basically just create a bare Git repo and let gatekeeper curate and selectively push

Page 36: Distributed Developer Workflows using Git

Gatekeeper Workflow (1/2)

Gatekeeper remote repository. . .• git init �bare

Basically just create a bare Git repo and let gatekeeper curate and selectively push

Page 37: Distributed Developer Workflows using Git

Gatekeeper Workflow (2/2)

D E M O

Page 38: Distributed Developer Workflows using Git

Deployment Workflows (1/2)

Distributed systems deployment could bundlerollback with new release. . .

• git bundle create <file.bundle>

<branches,tags,etc>

Creating a bundle with those branches, tags and/or commit range

• git bundle verify <file.bundle>

Verify bundle is valid and will apply cleanly to deployed repository

• git bundle unbundle <file.bundle>

Unbundling subset of repository on deployment node

Page 39: Distributed Developer Workflows using Git

Deployment Workflows (1/2)

Distributed systems deployment could bundlerollback with new release. . .• git bundle create <file.bundle>

<branches,tags,etc>

Creating a bundle with those branches, tags and/or commit range

• git bundle verify <file.bundle>

Verify bundle is valid and will apply cleanly to deployed repository

• git bundle unbundle <file.bundle>

Unbundling subset of repository on deployment node

Page 40: Distributed Developer Workflows using Git

Deployment Workflows (1/2)

Distributed systems deployment could bundlerollback with new release. . .• git bundle create <file.bundle>

<branches,tags,etc>

Creating a bundle with those branches, tags and/or commit range

• git bundle verify <file.bundle>

Verify bundle is valid and will apply cleanly to deployed repository

• git bundle unbundle <file.bundle>

Unbundling subset of repository on deployment node

Page 41: Distributed Developer Workflows using Git

Deployment Workflows (1/2)

Distributed systems deployment could bundlerollback with new release. . .• git bundle create <file.bundle>

<branches,tags,etc>

Creating a bundle with those branches, tags and/or commit range

• git bundle verify <file.bundle>

Verify bundle is valid and will apply cleanly to deployed repository

• git bundle unbundle <file.bundle>

Unbundling subset of repository on deployment node

Page 42: Distributed Developer Workflows using Git

Deployment Workflows (2/2)

D E M O

Page 43: Distributed Developer Workflows using Git

Resources (1/2)

• http://git-scm.org• http://github.com• Pro Git by Scott Chacon

Page 44: Distributed Developer Workflows using Git

Questions?

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

@SusanPotter

Page 45: Distributed Developer Workflows using Git

Questions?

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

@SusanPotter