Distributed Developer Workflows using Git

Preview:

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.

Citation preview

Creating distributed development workflows using Git

Susan Potter

Champaign-Urbana Developer’s Meetup

August 8, 2011

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)

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)

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)

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)

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)

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)

VCS Dimensions

Delta DAG

Local RCS cp -r or hard links

Centralized CVS, Subversion, Perforce ?

Distributed Mercurial, Darcs Git, Bazaar

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”

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”

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”

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”

Gitting Started Locally (2/4)

$GIT_DIR => .git/

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

Gitting Started Locally (2/4)

$GIT_DIR => .git/• branches

• hooks• objects• refs• config & info

Gitting Started Locally (2/4)

$GIT_DIR => .git/• branches• hooks

• objects• refs• config & info

Gitting Started Locally (2/4)

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

• refs• config & info

Gitting Started Locally (2/4)

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

• config & info

Gitting Started Locally (2/4)

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

Gitting Started Locally (3/4)

$GIT_INDEX => .git/index

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

Gitting Started Locally (3/4)

$GIT_INDEX => .git/index

• staging area

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

Gitting Started Locally (3/4)

$GIT_INDEX => .git/index

• staging area• add files before commit

• can even add “patches”

Gitting Started Locally (3/4)

$GIT_INDEX => .git/index

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

Gitting Started Locally (4/4)

D E M O

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

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

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

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

Centralized Workflow (2/3)

Sharing to remote

• git pull <remove> <branch>

Pull from <remote> <branch>

• git push <remote> <branch>

Push to <remote> <branch>

Centralized Workflow (2/3)

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

Pull from <remote> <branch>

• git push <remote> <branch>

Push to <remote> <branch>

Centralized Workflow (2/3)

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

Pull from <remote> <branch>

• git push <remote> <branch>

Push to <remote> <branch>

Centralized Workflow (3/3)

D E M O(with branching)

Forking Workflow (1/2)

Forking remote repository. . .

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

Basically just a straight copy is necessary

Forking Workflow (1/2)

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

Basically just a straight copy is necessary

Forking Workflow (2/2)

D E M O

Gatekeeper Workflow (1/2)

Gatekeeper remote repository. . .

• git init �bare

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

Gatekeeper Workflow (1/2)

Gatekeeper remote repository. . .• git init �bare

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

Gatekeeper Workflow (2/2)

D E M O

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

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

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

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

Deployment Workflows (2/2)

D E M O

Resources (1/2)

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

Questions?

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

@SusanPotter

Questions?

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

@SusanPotter

Recommended