Your SlideShare is downloading. ×
Git workflows for Drupal  projects Mack Hardy, Raphael Huefner, Smith Milner, Shawn Price @AffinityBridge
What is a workflow? "... a  sequence of connected steps " -Wikipedia The workflow we are looking for is an  effi...
What is Git, and why should you use it <ul><ul><li>Distributed version control system </li></ul></ul><ul><ul><li>Fast </li...
SVN... in the beginning <ul><li>Our SVN workflow: </li></ul><ul><ul><li>branching is hard(er) </li></ul></ul><ul><ul><li>a...
The move to Git <ul><ul><li>All the cool kids using it </li></ul></ul><ul><ul><li>Seemed to solve some of our SVN pain poi...
Submodules Everywhere $ git submodule add http://git.drupal.org/project/views.git  sites/all/modules/contrib/views Don't f...
Where We Landed <ul><ul><li>Everything in one Git repo (i.e. no Git submodules) </li></ul></ul><ul><ul><li>2 long-living b...
from nvie.com
https://github.com/affinitybridge/gitflowtalk/network Network Graph from GitHub
The &quot;gitflow&quot; Git extension <ul><ul><li>Based on the previous graph </li></ul></ul><ul><ul><li>Project page http...
gitflow: prepare repository $ git flow init rough equivalent: $ git init # if necessary $ # do some configuration (save pr...
gitflow: start feature branch $ git flow feature start <featurename> rough equivalent: $ git checkout -b feature/<featuren...
gitflow: finish feature branch $ git flow feature finish <featurename> rough equivalent: $ git checkout develop $ git merg...
gitflow: start release branch $ git flow release start <release#> rough equivalent: $ git checkout -b release/<release#> d...
gitflow: finish release branch $ git flow release finish <release#> rough equivalent: $ git checkout master $ git merge --...
gitflow: start hotfix branch $ git flow hotfix start <hotfix#> rough equivalent: $ git checkout -b hotfix/<hotfix#> master
gitflow: finish hotfix branch $ git flow hotfix finish <hotfix#> rough equivalent: $ git checkout master $ git merge --no-...
Git Deployment Consolidating the work of multiple developers and preparing it for release. Always have that production rea...
 
GIT and the Drupal Community <ul><ul><li>Drupal.org is now using GIT for version control. </li></ul></ul><ul><ul><li>Choos...
Wrapping Up <ul><ul><li>This is what works for us. You may find a process that fits you better. </li></ul></ul><ul><ul><li...
Resources http://affinitybridge.com Git Flow  https://github.com/nvie/gitflow NVIE Branching Model http://nvie.com/posts/a...
Upcoming SlideShare
Loading in...5
×

Git workflows presentation

2,067

Published on

This is a presentation give to the Vancouver Drupal users group about moving to GIT as a version control system for a small development team. The presentation details the workflow we settled on, and the git flow method for branch management. You can see a video of the presentation here - http://www.ustream.tv/recorded/13544036

Published in: Technology, Business
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,067
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Transcript of "Git workflows presentation"

  1. 1. Git workflows for Drupal  projects Mack Hardy, Raphael Huefner, Smith Milner, Shawn Price @AffinityBridge
  2. 2. What is a workflow? &quot;... a  sequence of connected steps &quot; -Wikipedia The workflow we are looking for is an efficient method to allow multiple developers to integrate working code into a project. 
  3. 3. What is Git, and why should you use it <ul><ul><li>Distributed version control system </li></ul></ul><ul><ul><li>Fast </li></ul></ul><ul><ul><li>Easy and cheap branching </li></ul></ul><ul><ul><li>Drupal.org uses GIT </li></ul></ul>
  4. 4. SVN... in the beginning <ul><li>Our SVN workflow: </li></ul><ul><ul><li>branching is hard(er) </li></ul></ul><ul><ul><li>all work committed to and deployed from /trunk and release tags </li></ul></ul><ul><ul><li>could not commit locally, hard to work offline </li></ul></ul><ul><ul><li>hidden .svn folders made module updates difficult </li></ul></ul>
  5. 5. The move to Git <ul><ul><li>All the cool kids using it </li></ul></ul><ul><ul><li>Seemed to solve some of our SVN pain points </li></ul></ul><ul><ul><li>Wasn't as easy as we'd hoped </li></ul></ul><ul><ul><li>Expect productivity to go down before it goes up </li></ul></ul>
  6. 6. Submodules Everywhere $ git submodule add http://git.drupal.org/project/views.git sites/all/modules/contrib/views Don't forget to push all commits to your submodules!
  7. 7. Where We Landed <ul><ul><li>Everything in one Git repo (i.e. no Git submodules) </li></ul></ul><ul><ul><li>2 long-living branches, &quot;master&quot; and &quot;develop&quot; </li></ul></ul><ul><ul><li>&quot;master&quot; is production ready all the time </li></ul></ul><ul><ul><li>Releases managed with tags </li></ul></ul><ul><ul><li>Separate &quot;feature&quot; or &quot;topic&quot; branches </li></ul></ul>
  8. 8. from nvie.com
  9. 9. https://github.com/affinitybridge/gitflowtalk/network Network Graph from GitHub
  10. 10. The &quot;gitflow&quot; Git extension <ul><ul><li>Based on the previous graph </li></ul></ul><ul><ul><li>Project page https://github.com/nvie/gitflow </li></ul></ul><ul><ul><li>&quot;water wings&quot; or &quot;training wheels&quot; to stay on track </li></ul></ul><ul><ul><li>Command shortcuts for repetitive tasks </li></ul></ul><ul><ul><li>Branch naming convention &quot;<prefix>/<name>&quot;  </li></ul></ul>
  11. 11. gitflow: prepare repository $ git flow init rough equivalent: $ git init # if necessary $ # do some configuration (save prefix choices) $ # if there's no &quot;develop&quot; branch yet, create one: $ git checkout -b develop master This brings you away from the master branch. You should never commit to it directly anymore.
  12. 12. gitflow: start feature branch $ git flow feature start <featurename> rough equivalent: $ git checkout -b feature/<featurename> develop
  13. 13. gitflow: finish feature branch $ git flow feature finish <featurename> rough equivalent: $ git checkout develop $ git merge --no-ff feature/<featurename> $ git branch -d feature/<featurename>
  14. 14. gitflow: start release branch $ git flow release start <release#> rough equivalent: $ git checkout -b release/<release#> develop
  15. 15. gitflow: finish release branch $ git flow release finish <release#> rough equivalent: $ git checkout master $ git merge --no-ff release/<release#> $ git tag -a <release#> $ git checkout develop $ git merge --no-ff release/<release#> $ git branch -d release/<release#>
  16. 16. gitflow: start hotfix branch $ git flow hotfix start <hotfix#> rough equivalent: $ git checkout -b hotfix/<hotfix#> master
  17. 17. gitflow: finish hotfix branch $ git flow hotfix finish <hotfix#> rough equivalent: $ git checkout master $ git merge --no-ff hotfix/<hotfix#> $ git tag -a <hotfix#> $ git checkout develop $ git merge --no-ff hotfix/<hotfix#> $ git branch -d hotfix/<hotfix#>
  18. 18. Git Deployment Consolidating the work of multiple developers and preparing it for release. Always have that production ready branch.
  19. 20. GIT and the Drupal Community <ul><ul><li>Drupal.org is now using GIT for version control. </li></ul></ul><ul><ul><li>Choosing Git for your own code means less tools to learn when also contributing to Drupal projects. </li></ul></ul><ul><ul><li>Git makes it easy to create and apply patches using  &quot;git diff&quot; and &quot;git apply&quot;. </li></ul></ul><ul><li>                http://drupal.org/node/1054616#applying-patches </li></ul>
  20. 21. Wrapping Up <ul><ul><li>This is what works for us. You may find a process that fits you better. </li></ul></ul><ul><ul><li>Big win for us is ability to create new branches on a whim. </li></ul></ul><ul><ul><li>Knowing that master is always production ready helps us sleep at night. </li></ul></ul>
  21. 22. Resources http://affinitybridge.com Git Flow  https://github.com/nvie/gitflow NVIE Branching Model http://nvie.com/posts/a-successful-git-branching-model/ SVN to GIT Crash Course https://git.wiki.kernel.org/index.php/GitSvnCrashCourse

×