distributed developer workflows using git
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/1.jpg)
Creating distributed development workflows using Git
Susan Potter
Champaign-Urbana Developer’s Meetup
August 8, 2011
![Page 2: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/2.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/3.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/4.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/5.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/6.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/7.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/8.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/9.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/10.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/11.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/12.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/13.jpg)
Gitting Started Locally (2/4)
$GIT_DIR => .git/
• branches• hooks• objects• refs• config & info
![Page 14: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/14.jpg)
Gitting Started Locally (2/4)
$GIT_DIR => .git/• branches
• hooks• objects• refs• config & info
![Page 15: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/15.jpg)
Gitting Started Locally (2/4)
$GIT_DIR => .git/• branches• hooks
• objects• refs• config & info
![Page 16: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/16.jpg)
Gitting Started Locally (2/4)
$GIT_DIR => .git/• branches• hooks• objects
• refs• config & info
![Page 17: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/17.jpg)
Gitting Started Locally (2/4)
$GIT_DIR => .git/• branches• hooks• objects• refs
• config & info
![Page 18: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/18.jpg)
Gitting Started Locally (2/4)
$GIT_DIR => .git/• branches• hooks• objects• refs• config & info
![Page 19: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/19.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/20.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/21.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/22.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/23.jpg)
Gitting Started Locally (4/4)
D E M O
![Page 24: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/24.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/25.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/26.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/27.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/28.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/29.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/30.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/31.jpg)
Centralized Workflow (3/3)
D E M O(with branching)
![Page 32: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/32.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/33.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/34.jpg)
Forking Workflow (2/2)
D E M O
![Page 35: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/35.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/36.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/37.jpg)
Gatekeeper Workflow (2/2)
D E M O
![Page 38: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/38.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/39.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/40.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/41.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/42.jpg)
Deployment Workflows (2/2)
D E M O
![Page 43: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/43.jpg)
Resources (1/2)
• http://git-scm.org• http://github.com• Pro Git by Scott Chacon
![Page 44: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/44.jpg)
Questions?
Figure: http://www.flickr.com/photos/42682395@N04/
@SusanPotter
![Page 45: Distributed Developer Workflows using Git](https://reader033.vdocuments.mx/reader033/viewer/2022052410/5550f5bfb4c90501448b4724/html5/thumbnails/45.jpg)
Questions?
Figure: http://www.flickr.com/photos/42682395@N04/
@SusanPotter