PlantUMLでgitのブランチ図を書いてみた

はじめに

  • gitのブランチ図を描ける良いツールは無いか探している
  • 調べていたら、PlantUMLで描いているものを見つけた

    qiita.com

    fffw2.hateblo.jp

  • PlantUMLだとテキストベースなので便利かと思い、とりあえず試してみました

描いてみる

  • 上の1つ目の記事をベースにGit flowのブランチ図を描いてみます。
  • ほぼコピペなんですが、1点だけ以下の変更を加えました。

PlantUMLのコード

@startuml gitflow

skinparam shadowing false
skinparam ArrowColor #dimgray
skinparam EntityBorderColor #gray
skinparam SequenceLifeLineBorderColor #gray
skinparam NoteBorderColor #grey
skinparam NoteBackgroundColor #gainsboro
skinparam SequenceDividerBorderColor #gray
skinparam SequenceDividerFontStyle normal
skinparam maxmessagesize 60
hide footbox

entity "feature/#2" as feature_2 #hotpink
entity "feature/#1" as feature_1 #hotpink
entity develop  #gold
entity release #limegreen
entity hotfixes  #orangered
entity master  #lightskyblue

master ++
develop ++
== Development ==

?->o master
note right : Tag 0.1
develop o<- master
develop ->o develop
feature_1 o<- develop ++: next release
feature_2 o<- develop ++ : future release
feature_1 ->o feature_1
feature_2 ->o feature_2

== Production Bugfix ==

hotfixes o<- master ++ : hotfix 0.2
hotfixes ->o master 
note right : Tag 0.2
develop o<- hotfixes -- : bugfix in develop

== Production Release ==

feature_1 ->o develop --
develop ->o release ++ : start of release for 1.0
release ->o release : only bugfixes!
release ->o master 
note right : Tag 1.0
develop o<- release -- : merged back into develop

== Development continues ==

feature_2->o develop --
develop ->o release ++
release ->o master
develop o<- release --

出来た図

とても良い感じです

おわりに

  • PlantUMLを使ってブランチ図を描いてみました
  • テキストベースで管理できるのは便利なので、ブランチ図を描く方法の1つとして覚えて置きたいと思いました。