Distributed Developer Workflows using Git

3,139 views

Published on

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.

Published in: Technology
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
3,139
On SlideShare
0
From Embeds
0
Number of Embeds
20
Actions
Shares
0
Downloads
22
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Distributed Developer Workflows using Git

  1. 1. Creating distributed development workflows using Git Susan Potter Champaign-Urbana Developer’s Meetup August 8, 2011
  2. 2. Scope of Talk • How does Git differ. . . ? CVS, Subversion, Perforce, Mercurial
  3. 3. Scope of Talk • How does Git differ. . . ? CVS, Subversion, Perforce, Mercurial • Gitting Started Locally Server configuration management
  4. 4. 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)
  5. 5. Scope of Talk • How does Git differ. . . ? • Forking Workflows CVS, Subversion, Perforce, Mercurial (the GitHub model) • Gitting Started Locally Server configuration management • Centralized Remote (a.k.a. a better Subversion)
  6. 6. Scope of Talk • How does Git differ. . . ? • Forking Workflows CVS, Subversion, Perforce, Mercurial (the GitHub model) • Gitting Started Locally • Gatekeeper Workflows Server configuration management (enterprise release management) • Centralized Remote (a.k.a. a better Subversion)
  7. 7. Scope of Talk • How does Git differ. . . ? • Forking Workflows CVS, Subversion, Perforce, Mercurial (the GitHub model) • Gitting Started Locally • Gatekeeper Workflows Server configuration management (enterprise release management) • Centralized Remote • Deployment Strategies? (a.k.a. a better Subversion) (scalable distributed deployment)
  8. 8. VCS Dimensions Delta DAG Local RCS cp -r or hard links Centralized CVS, Subversion, Perforce ? Distributed Mercurial, Darcs Git, Bazaar
  9. 9. Gitting Started Locally (1/4) Initializing local repo inside working directory
  10. 10. Gitting Started Locally (1/4) Initializing local repo inside working directory • git init
  11. 11. Gitting Started Locally (1/4) Initializing local repo inside working directory • git init • git config user.email “user@domain”
  12. 12. 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”
  13. 13. Gitting Started Locally (2/4) $GIT_DIR => .git/
  14. 14. Gitting Started Locally (2/4) $GIT_DIR => .git/ • branches
  15. 15. Gitting Started Locally (2/4) $GIT_DIR => .git/ • branches • hooks
  16. 16. Gitting Started Locally (2/4) $GIT_DIR => .git/ • branches • hooks • objects
  17. 17. Gitting Started Locally (2/4) $GIT_DIR => .git/ • branches • hooks • objects • refs
  18. 18. Gitting Started Locally (2/4) $GIT_DIR => .git/ • branches • hooks • objects • refs • config & info
  19. 19. Gitting Started Locally (3/4) $GIT_INDEX => .git/index
  20. 20. Gitting Started Locally (3/4) $GIT_INDEX => .git/index • staging area
  21. 21. Gitting Started Locally (3/4) $GIT_INDEX => .git/index • staging area • add files before commit
  22. 22. Gitting Started Locally (3/4) $GIT_INDEX => .git/index • staging area • add files before commit • can even add “patches”
  23. 23. Gitting Started Locally (4/4) DEMO
  24. 24. Centralized Workflow (1/3) Adding a remote
  25. 25. Centralized Workflow (1/3) Adding a remote • git init bare Create remote “bare” repo
  26. 26. 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.
  27. 27. 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
  28. 28. Centralized Workflow (2/3) Sharing to remote
  29. 29. Centralized Workflow (2/3) Sharing to remote • git pull <remove> <branch> Pull from <remote> <branch>
  30. 30. Centralized Workflow (2/3) Sharing to remote • git pull <remove> <branch> Pull from <remote> <branch> • git push <remote> <branch> Push to <remote> <branch>
  31. 31. Centralized Workflow (3/3) DEMO (with branching)
  32. 32. Forking Workflow (1/2) Forking remote repository. . .
  33. 33. Forking Workflow (1/2) Forking remote repository. . . • cp -r <orig.repo> <forked.repo> Basically just a straight copy is necessary
  34. 34. Forking Workflow (2/2) DEMO
  35. 35. Gatekeeper Workflow (1/2) Gatekeeper remote repository. . .
  36. 36. Gatekeeper Workflow (1/2) Gatekeeper remote repository. . . • git init bare Basically just create a bare Git repo and let gatekeeper curate and selectively push
  37. 37. Gatekeeper Workflow (2/2) DEMO
  38. 38. Deployment Workflows (1/2) Distributed systems deployment could bundle rollback with new release. . .
  39. 39. Deployment Workflows (1/2) Distributed systems deployment could bundle rollback with new release. . . • git bundle create <file.bundle> <branches,tags,etc> Creating a bundle with those branches, tags and/or commit range
  40. 40. Deployment Workflows (1/2) Distributed systems deployment could bundle rollback 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
  41. 41. Deployment Workflows (1/2) Distributed systems deployment could bundle rollback 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
  42. 42. Deployment Workflows (2/2) DEMO
  43. 43. Resources (1/2) • http://git-scm.org • http://github.com • Pro Git by Scott Chacon
  44. 44. Questions? Figure: http://www.flickr.com/photos/42682395@N04/
  45. 45. Questions? Figure: http://www.flickr.com/photos/42682395@N04/ @SusanPotter

×