Zum Inhalt springen

Git Flow: Unterschied zwischen den Versionen

Aus Computech CMS Wiki
Frederick (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Frederick (Diskussion | Beiträge)
Zeile 37: Zeile 37:


=== Git Flow Branch Examples ===
=== Git Flow Branch Examples ===
Good images of how the different types of Git Flow branch methods work can be seen in the [https://gitversion.readthedocs.io/en/latest/git-branching-strategies/gitflow-examples/ GitFlow Examples in the Git Version documentation].
Good images of how the different types of Git Flow branch methods work can be seen in the [https://gitversion.readthedocs.io/en/latest/git-branching-strategies/gitflow-examples/ GitFlow Examples in the Git Version documentation]. These images can help to give a very quick visual understanding of how the Git Flow branching method works.

Version vom 19. Dezember 2016, 08:09 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). Git Flow does not take away the ability to use the normal Git commands. It does group together commands needed to carry out a Git Flow branching method step without the user needing to remember all the multiple necessary steps needed to finish what should be a simple step.

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

Fehler beim Erstellen des Vorschaubildes: Datei fehlt

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

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. This is an additional branch that is pushed to for deployment to the testing server. This branch is not in the original Git Flow branching method.

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. Feature branches are merged back into the dev branch when the work is finished and deleted. 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 then the normal `git flow hotfix finish` command can be used to merge it back into the live branch, and also merge it into the dev branch, so that the hotfix is included in the next release as well.

bugfix branches

Bugfix branches are checked out from the dev branch to fix bugs in the development branch. When finhished they are merged back into the dev branch.s 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).

release branches

Release branches are used for both major and minor releases for stabilisation before a release. Release branches are taken off the dev branch then merged to both dev and live branches. Finally the live branch is tagged with the released version.

support branches

Support branches are not really covered in GitFlow, but are essential if you need to maintain multiple major versions at the same time. You could use support branches for supporting minor releases as well. Support branches were added in git-flow-avh.

Git Flow Branch Examples

Good images of how the different types of Git Flow branch methods work can be seen in the GitFlow Examples in the Git Version documentation. These images can help to give a very quick visual understanding of how the Git Flow branching method works.