Git Flow: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
|||
| Zeile 8: | Zeile 8: | ||
[[Datei:git-model@2x.png|center|575px]] | [[Datei:git-model@2x.png|center|575px]] | ||
== Branch Names == | === Getting started - Introduction to Git Flow === | ||
For the best introduction to getting started with git flow, please read Jeff Kreeftmeijer's blog post:[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/ Using git-flow to automate your git branching workflow] | |||
== Using Git Flow for Drupal Website Development == | |||
The Git Flow branching method can and is used by teams developing Drupal website. Depending on your deployment method some slight changes maybe needed. The names of the branches given in the original Git Flow method make sense for developing code but other names may make more sense when it is used for Drupal website development. | |||
=== Branch Names === | |||
One important thing to note is that the branch names are only that names. There is nothing special about the branch names and you can setup the names to be what you want. I tried to use a set of branch names that were short but also described what the branch was used for in Drupal web development. The original names may make more sense when developing software code. I use the names from Shawn DeArmond's presentation at Bad Camp 2012 called "[ Development Workflow With Git]"([http://dearmond.net/blog/2012/11/drupal-development-workflow-git Blog Post]) ([http://dearmond.net/sites/dearmond.net/files/media/2012/11/dev_workflow_with_git.pdf PDF of Slides (slide 23 has the branch names)])([https://vimeo.com/52891166 Video of Presentation]) as they made the most sense of any I saw. Here is a list of the branch names that I use with a reference to the branch name that Vincent used in his original article. | One important thing to note is that the branch names are only that names. There is nothing special about the branch names and you can setup the names to be what you want. I tried to use a set of branch names that were short but also described what the branch was used for in Drupal web development. The original names may make more sense when developing software code. I use the names from Shawn DeArmond's presentation at Bad Camp 2012 called "[ Development Workflow With Git]"([http://dearmond.net/blog/2012/11/drupal-development-workflow-git Blog Post]) ([http://dearmond.net/sites/dearmond.net/files/media/2012/11/dev_workflow_with_git.pdf PDF of Slides (slide 23 has the branch names)])([https://vimeo.com/52891166 Video of Presentation]) as they made the most sense of any I saw. Here is a list of the branch names that I use with a reference to the branch name that Vincent used in his original article. | ||
*'''dev''' (Originally develop) - This is the branch were development work is started from and merge back into. | *'''dev''' (Originally develop) - This is the branch were development work is started from and merge back into. | ||
*'''test''' (Originally release branches) - This is the branch where code gets tested in a environment identical to where it will be used. In Drupal this is where the the code from the dev branch and the database from the live site can be tested together to see if things work as expected. In the original branching model a new release branch was created for each new release. | *'''test''' (Originally release branches) - This is the branch where code ideally gets tested in a environment identical to where it will be used live. In Drupal this is where the the code from the dev branch and the database from the live site can be tested together to see if things work as expected. In the original branching model a new release branch was created for each new release. I add tag version number tags to releases pushed to the test branch. | ||
*'''live''' (Originally master) - This is the branch that is used on the live website. Pushing to this branch and then deploying results in the code going live. | *'''live''' (Originally master) - This is the branch that is used on the live website. Pushing to this branch and then deploying results in the code going live. | ||
*'''feature branches''' - Feature branches are checked out from the dev branch. For each feature a branch should be made then merged back into the dev branch | *'''feature branches''' - Feature branches are checked out from the dev branch. For each feature a branch should be made then merged back into the dev branch when the work is finished. These branches are normally only in a developer's development environment. If other developers need to have this code before it is finished Git Flow has a publish method that allows pushing the feature branch to the remote so other developers can then have access to it. | ||
*'''hotfix branches''' - Hotfix branches are checked out from the live branch to fix a critical bug in the code on the live site. When finished, the hotfix branch | *'''hotfix branches''' - Hotfix branches are checked out from the live branch to fix a critical bug in the code on the live site. When finished, the hotfix branch should be merged to the test branch for testing. If all is well it should then be merged back into the live branch, but also needs to be merged back into the dev branch, in order to safeguard that the hotfix is included in the next release as well. | ||
*'''bugfix branches''' - Since late in 2012 the original [https://github.com/nvie/gitflow Git Flow repository] by Vincent Driessen on Github is no longer being updated. Peter van der Does started a new repository on Github in early 2012 called [https://github.com/petervanderdoes/gitflow-avh gitflow-avh]. Ubuntu and other Linuxes have switched to this repository for the packages they include for git-flow. | |||
Bugfix branches are one of the new features that was added in the git-flow-avh (A VirtualHome). | |||
For | For the feature, bugfix, and hotfix branches after the final merge back into needed branches the branch can be deleted. | ||
Version vom 18. Dezember 2016, 22:49 Uhr
Git Flow is a collection of Git extensions to provide high-level repository operations for Vincent Driessen's Git Flow branching model (PDF Diagram of GitFlow branching).
Vincent Driessen's Blog Post - "A successful Git branching model"
Vincent Driessen's Blog Post on Tuesday, January 05, 2010 titled "A successful Git branching model" is origin of what is called to today the Git Flow branching model.
Vincent Driessen Git Flow Diagram
Getting started - Introduction to Git Flow
For the best introduction to getting started with git flow, please read Jeff Kreeftmeijer's blog post:Using git-flow to automate your git branching workflow
Using Git Flow for Drupal Website Development
The Git Flow branching method can and is used by teams developing Drupal website. Depending on your deployment method some slight changes maybe needed. The names of the branches given in the original Git Flow method make sense for developing code but other names may make more sense when it is used for Drupal website development.
Branch Names
One important thing to note is that the branch names are only that names. There is nothing special about the branch names and you can setup the names to be what you want. I tried to use a set of branch names that were short but also described what the branch was used for in Drupal web development. The original names may make more sense when developing software code. I use the names from Shawn DeArmond's presentation at Bad Camp 2012 called "[ Development Workflow With Git]"(Blog Post) (PDF of Slides (slide 23 has the branch names))(Video of Presentation) as they made the most sense of any I saw. Here is a list of the branch names that I use with a reference to the branch name that Vincent used in his original article.
- dev (Originally develop) - This is the branch were development work is started from and merge back into.
- test (Originally release branches) - This is the branch where code ideally gets tested in a environment identical to where it will be used live. In Drupal this is where the the code from the dev branch and the database from the live site can be tested together to see if things work as expected. In the original branching model a new release branch was created for each new release. I add tag version number tags to releases pushed to the test branch.
- live (Originally master) - This is the branch that is used on the live website. Pushing to this branch and then deploying results in the code going live.
- feature branches - Feature branches are checked out from the dev branch. For each feature a branch should be made then merged back into the dev branch when the work is finished. These branches are normally only in a developer's development environment. If other developers need to have this code before it is finished Git Flow has a publish method that allows pushing the feature branch to the remote so other developers can then have access to it.
- hotfix branches - Hotfix branches are checked out from the live branch to fix a critical bug in the code on the live site. When finished, the hotfix branch should be merged to the test branch for testing. If all is well it should then be merged back into the live branch, but also needs to be merged back into the dev branch, in order to safeguard that the hotfix is included in the next release as well.
- bugfix branches - Since late in 2012 the original Git Flow repository by Vincent Driessen on Github is no longer being updated. Peter van der Does started a new repository on Github in early 2012 called gitflow-avh. Ubuntu and other Linuxes have switched to this repository for the packages they include for git-flow.
Bugfix branches are one of the new features that was added in the git-flow-avh (A VirtualHome).
For the feature, bugfix, and hotfix branches after the final merge back into needed branches the branch can be deleted.