Last active
February 27, 2018 22:27
-
-
Save lsloan/c4e0fbcb56d5cf83bf96 to your computer and use it in GitHub Desktop.
Diagram of a common GitHub workflow (short URL: https://goo.gl/79JCB9)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph G { | |
label = "GitHub Workflow\nSource: https://goo.gl/79JCB9" | |
labelloc = "t" | |
subgraph cluster_upstream { | |
label = upstream | |
style = filled | |
color = lightgrey | |
node [style = filled color = white] | |
upstreamMaster0 [label = master] | |
upstreamMaster1 [label = master] | |
pullRequest [label = "pull request" shape = box] | |
// Invisible links to establish node order within cluster. | |
upstreamMaster0 -> pullRequest -> upstreamMaster1 [style = invis] | |
} | |
subgraph cluster_fork { | |
label = fork | |
node [style = filled] | |
color = blue | |
forkMaster0 [label = master] | |
forkMaster1 [label = master] | |
forkBranch0 [label = branch] | |
forkBranch1 [label = branch] | |
forkBranchDelete [label = "delete branch\n(optional)" | |
shape = box peripheries = 2] | |
// Invisible links to establish node order within cluster. | |
forkMaster0 -> forkBranch0 -> forkBranch1 -> forkMaster1 -> | |
forkBranchDelete [style = invis] | |
} | |
subgraph cluster_local { | |
label = local | |
node [style = filled] | |
color = red | |
localMaster0 [label = master] | |
localMaster1 [label = master] | |
localBranch0 [label = branch] | |
localBranch1 [label = branch] | |
localBranchDelete [label = "delete branch\n(optional)" | |
shape = box peripheries = 2] | |
// Invisible links to establish node order within cluster. | |
localMaster0 -> localBranch0 -> localBranch1 -> | |
localMaster1 -> localBranchDelete [style = invis] | |
} | |
start [shape = Mdiamond] | |
end [shape = Msquare] | |
// Undocumented (?) "newrank" enables "rank = same" directives | |
newrank = true | |
// If ranks are specified before node and cluster definitions, | |
// nodes are not shown in their correct styles. | |
{rank = same upstreamMaster0 forkMaster0 localMaster0} | |
{rank = same forkBranch0 localBranch0} | |
{rank = same forkBranch1 localBranch1 pullRequest} | |
{rank = same upstreamMaster1 localMaster1} | |
{rank = same forkBranchDelete localBranchDelete} | |
start -> upstreamMaster0 | |
upstreamMaster0 -> forkMaster0 [label = fork] | |
forkMaster0 -> forkBranch0 [label = branch] | |
forkMaster0 -> localMaster0 [label = clone] | |
forkBranch0 -> localBranch0 [label = clone] | |
localBranch0 -> localBranch0 [label = work] | |
localBranch0 -> localBranch1 [label = commit] | |
localBranch1 -> forkBranch1 [label = push] | |
pullRequest -> upstreamMaster0 [style = dashed] | |
pullRequest -> forkBranch1 [style = dashed] | |
pullRequest -> upstreamMaster1 [label = merge] | |
upstreamMaster1 -> localMaster1 [label = pull] | |
localMaster1 -> forkMaster1 [label = push] | |
forkMaster1 -> forkBranchDelete | |
forkBranchDelete -> localBranchDelete [color = "black:black" dir = none] | |
forkBranchDelete -> end | |
//localBranchDelete -> end | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" | |
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | |
<!-- Generated by graphviz version 2.38.0 (20140413.2041) | |
--> | |
<!-- Title: G Pages: 1 --> | |
<svg width="395pt" height="681pt" | |
viewBox="0.00 0.00 395.00 681.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | |
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 677)"> | |
<title>G</title> | |
<polygon fill="white" stroke="none" points="-4,4 -4,-677 391,-677 391,4 -4,4"/> | |
<text text-anchor="middle" x="193.5" y="-657.8" font-family="Times,serif" font-size="14.00">GitHub Workflow</text> | |
<text text-anchor="middle" x="193.5" y="-642.8" font-family="Times,serif" font-size="14.00">Source: https://goo.gl/79JCB9</text> | |
<g id="clust2" class="cluster"><title>cluster_fork</title> | |
<polygon fill="none" stroke="blue" points="114,-66 114,-572 230,-572 230,-66 114,-66"/> | |
<text text-anchor="middle" x="172" y="-556.8" font-family="Times,serif" font-size="14.00">fork</text> | |
</g> | |
<g id="clust1" class="cluster"><title>cluster_upstream</title> | |
<polygon fill="lightgrey" stroke="lightgrey" points="8,-236 8,-572 106,-572 106,-236 8,-236"/> | |
<text text-anchor="middle" x="57" y="-556.8" font-family="Times,serif" font-size="14.00">upstream</text> | |
</g> | |
<g id="clust3" class="cluster"><title>cluster_local</title> | |
<polygon fill="none" stroke="red" points="244,-66 244,-572 379,-572 379,-66 244,-66"/> | |
<text text-anchor="middle" x="311.5" y="-556.8" font-family="Times,serif" font-size="14.00">local</text> | |
</g> | |
<!-- upstreamMaster0 --> | |
<g id="node1" class="node"><title>upstreamMaster0</title> | |
<ellipse fill="white" stroke="white" cx="57" cy="-523" rx="35.194" ry="18"/> | |
<text text-anchor="middle" x="57" y="-519.3" font-family="Times,serif" font-size="14.00">master</text> | |
</g> | |
<!-- pullRequest --> | |
<g id="node3" class="node"><title>pullRequest</title> | |
<polygon fill="white" stroke="white" points="98,-367 16,-367 16,-331 98,-331 98,-367"/> | |
<text text-anchor="middle" x="57" y="-345.3" font-family="Times,serif" font-size="14.00">pull request</text> | |
</g> | |
<!-- upstreamMaster0->pullRequest --> | |
<!-- forkMaster0 --> | |
<g id="node4" class="node"><title>forkMaster0</title> | |
<ellipse fill="lightgrey" stroke="black" cx="169" cy="-523" rx="35.194" ry="18"/> | |
<text text-anchor="middle" x="169" y="-519.3" font-family="Times,serif" font-size="14.00">master</text> | |
</g> | |
<!-- upstreamMaster0->forkMaster0 --> | |
<g id="edge12" class="edge"><title>upstreamMaster0->forkMaster0</title> | |
<path fill="none" stroke="black" d="M92.1302,-523C102.042,-523 112.971,-523 123.401,-523"/> | |
<polygon fill="black" stroke="black" points="123.609,-526.5 133.609,-523 123.609,-519.5 123.609,-526.5"/> | |
<text text-anchor="middle" x="113" y="-529.8" font-family="Times,serif" font-size="14.00">fork</text> | |
</g> | |
<!-- upstreamMaster1 --> | |
<g id="node2" class="node"><title>upstreamMaster1</title> | |
<ellipse fill="white" stroke="white" cx="55" cy="-262" rx="35.194" ry="18"/> | |
<text text-anchor="middle" x="55" y="-258.3" font-family="Times,serif" font-size="14.00">master</text> | |
</g> | |
<!-- localMaster1 --> | |
<g id="node10" class="node"><title>localMaster1</title> | |
<ellipse fill="lightgrey" stroke="black" cx="288" cy="-262" rx="35.194" ry="18"/> | |
<text text-anchor="middle" x="288" y="-258.3" font-family="Times,serif" font-size="14.00">master</text> | |
</g> | |
<!-- upstreamMaster1->localMaster1 --> | |
<g id="edge22" class="edge"><title>upstreamMaster1->localMaster1</title> | |
<path fill="none" stroke="black" d="M90.1347,-262C130.739,-262 197.683,-262 242.303,-262"/> | |
<polygon fill="black" stroke="black" points="242.579,-265.5 252.579,-262 242.579,-258.5 242.579,-265.5"/> | |
<text text-anchor="middle" x="171.5" y="-268.8" font-family="Times,serif" font-size="14.00">pull</text> | |
</g> | |
<!-- pullRequest->upstreamMaster0 --> | |
<g id="edge19" class="edge"><title>pullRequest->upstreamMaster0</title> | |
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M61.2364,-367.052C64.2715,-396.88 64.558,-458.764 62.0958,-494.643"/> | |
<polygon fill="black" stroke="black" points="58.5855,-494.623 61.2435,-504.879 65.5613,-495.204 58.5855,-494.623"/> | |
</g> | |
<!-- pullRequest->upstreamMaster1 --> | |
<!-- pullRequest->upstreamMaster1 --> | |
<g id="edge21" class="edge"><title>pullRequest->upstreamMaster1</title> | |
<path fill="none" stroke="black" d="M56.5953,-330.799C56.3215,-319.163 55.9541,-303.548 55.6409,-290.237"/> | |
<polygon fill="black" stroke="black" points="59.1385,-290.09 55.4041,-280.175 52.1404,-290.255 59.1385,-290.09"/> | |
<text text-anchor="middle" x="74.5" y="-301.8" font-family="Times,serif" font-size="14.00">merge</text> | |
</g> | |
<!-- forkBranch1 --> | |
<g id="node7" class="node"><title>forkBranch1</title> | |
<ellipse fill="lightgrey" stroke="black" cx="170" cy="-349" rx="35.9954" ry="18"/> | |
<text text-anchor="middle" x="170" y="-345.3" font-family="Times,serif" font-size="14.00">branch</text> | |
</g> | |
<!-- pullRequest->forkBranch1 --> | |
<g id="edge20" class="edge"><title>pullRequest->forkBranch1</title> | |
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M98.0508,-349C106.67,-349 115.289,-349 123.908,-349"/> | |
<polygon fill="black" stroke="black" points="124.025,-352.5 134.025,-349 124.025,-345.5 124.025,-352.5"/> | |
</g> | |
<!-- forkBranch0 --> | |
<g id="node6" class="node"><title>forkBranch0</title> | |
<ellipse fill="lightgrey" stroke="black" cx="168" cy="-436" rx="35.9954" ry="18"/> | |
<text text-anchor="middle" x="168" y="-432.3" font-family="Times,serif" font-size="14.00">branch</text> | |
</g> | |
<!-- forkMaster0->forkBranch0 --> | |
<!-- forkMaster0->forkBranch0 --> | |
<g id="edge13" class="edge"><title>forkMaster0->forkBranch0</title> | |
<path fill="none" stroke="black" d="M168.798,-504.799C168.661,-493.163 168.477,-477.548 168.32,-464.237"/> | |
<polygon fill="black" stroke="black" points="171.82,-464.134 168.202,-454.175 164.82,-464.216 171.82,-464.134"/> | |
<text text-anchor="middle" x="188.5" y="-475.8" font-family="Times,serif" font-size="14.00">branch</text> | |
</g> | |
<!-- localMaster0 --> | |
<g id="node9" class="node"><title>localMaster0</title> | |
<ellipse fill="lightgrey" stroke="black" cx="288" cy="-523" rx="35.194" ry="18"/> | |
<text text-anchor="middle" x="288" y="-519.3" font-family="Times,serif" font-size="14.00">master</text> | |
</g> | |
<!-- forkMaster0->localMaster0 --> | |
<g id="edge14" class="edge"><title>forkMaster0->localMaster0</title> | |
<path fill="none" stroke="black" d="M204.382,-523C216.264,-523 229.691,-523 242.253,-523"/> | |
<polygon fill="black" stroke="black" points="242.549,-526.5 252.549,-523 242.549,-519.5 242.549,-526.5"/> | |
<text text-anchor="middle" x="228.5" y="-529.8" font-family="Times,serif" font-size="14.00">clone</text> | |
</g> | |
<!-- forkMaster1 --> | |
<g id="node5" class="node"><title>forkMaster1</title> | |
<ellipse fill="lightgrey" stroke="black" cx="172" cy="-175" rx="35.194" ry="18"/> | |
<text text-anchor="middle" x="172" y="-171.3" font-family="Times,serif" font-size="14.00">master</text> | |
</g> | |
<!-- forkBranchDelete --> | |
<g id="node8" class="node"><title>forkBranchDelete</title> | |
<polygon fill="lightgrey" stroke="black" points="218,-116 126,-116 126,-78 218,-78 218,-116"/> | |
<polygon fill="none" stroke="black" points="222,-120 122,-120 122,-74 222,-74 222,-120"/> | |
<text text-anchor="middle" x="172" y="-100.8" font-family="Times,serif" font-size="14.00">delete branch</text> | |
<text text-anchor="middle" x="172" y="-85.8" font-family="Times,serif" font-size="14.00">(optional)</text> | |
</g> | |
<!-- forkMaster1->forkBranchDelete --> | |
<!-- forkMaster1->forkBranchDelete --> | |
<g id="edge24" class="edge"><title>forkMaster1->forkBranchDelete</title> | |
<path fill="none" stroke="black" d="M177.72,-157.133C178.587,-149.19 178.907,-139.44 178.679,-130.165"/> | |
<polygon fill="black" stroke="black" points="182.167,-129.837 178.189,-120.017 175.175,-130.175 182.167,-129.837"/> | |
</g> | |
<!-- forkBranch0->forkBranch1 --> | |
<!-- localBranch0 --> | |
<g id="node11" class="node"><title>localBranch0</title> | |
<ellipse fill="lightgrey" stroke="black" cx="288" cy="-436" rx="35.9954" ry="18"/> | |
<text text-anchor="middle" x="288" y="-432.3" font-family="Times,serif" font-size="14.00">branch</text> | |
</g> | |
<!-- forkBranch0->localBranch0 --> | |
<g id="edge15" class="edge"><title>forkBranch0->localBranch0</title> | |
<path fill="none" stroke="black" d="M204.004,-436C215.87,-436 229.234,-436 241.755,-436"/> | |
<polygon fill="black" stroke="black" points="242.021,-439.5 252.021,-436 242.021,-432.5 242.021,-439.5"/> | |
<text text-anchor="middle" x="228" y="-442.8" font-family="Times,serif" font-size="14.00">clone</text> | |
</g> | |
<!-- forkBranch1->forkMaster1 --> | |
<!-- localBranchDelete --> | |
<g id="node13" class="node"><title>localBranchDelete</title> | |
<polygon fill="lightgrey" stroke="black" points="354,-116 262,-116 262,-78 354,-78 354,-116"/> | |
<polygon fill="none" stroke="black" points="358,-120 258,-120 258,-74 358,-74 358,-120"/> | |
<text text-anchor="middle" x="308" y="-100.8" font-family="Times,serif" font-size="14.00">delete branch</text> | |
<text text-anchor="middle" x="308" y="-85.8" font-family="Times,serif" font-size="14.00">(optional)</text> | |
</g> | |
<!-- forkBranchDelete->localBranchDelete --> | |
<g id="edge25" class="edge"><title>forkBranchDelete->localBranchDelete</title> | |
<path fill="none" stroke="black" d="M222.203,-96C234.045,-96 245.887,-96 257.728,-96"/> | |
<path fill="none" stroke="black" d="M222.203,-98C234.045,-98 245.887,-98 257.728,-98"/> | |
</g> | |
<!-- end --> | |
<g id="node15" class="node"><title>end</title> | |
<polygon fill="none" stroke="black" points="190.5,-37 153.5,-37 153.5,-0 190.5,-0 190.5,-37"/> | |
<polyline fill="none" stroke="black" points="165.5,-37 153.5,-25 "/> | |
<polyline fill="none" stroke="black" points="153.5,-12 165.5,-0 "/> | |
<polyline fill="none" stroke="black" points="178.5,-0 190.5,-12 "/> | |
<polyline fill="none" stroke="black" points="190.5,-25 178.5,-37 "/> | |
<text text-anchor="middle" x="172" y="-14.8" font-family="Times,serif" font-size="14.00">end</text> | |
</g> | |
<!-- forkBranchDelete->end --> | |
<g id="edge26" class="edge"><title>forkBranchDelete->end</title> | |
<path fill="none" stroke="black" d="M172,-73.873C172,-65.5908 172,-56.0742 172,-47.3411"/> | |
<polygon fill="black" stroke="black" points="175.5,-47.2128 172,-37.2128 168.5,-47.2129 175.5,-47.2128"/> | |
</g> | |
<!-- localMaster0->localBranch0 --> | |
<!-- localMaster1->forkMaster1 --> | |
<g id="edge23" class="edge"><title>localMaster1->forkMaster1</title> | |
<path fill="none" stroke="black" d="M268.584,-246.773C249.764,-232.982 221.025,-211.923 199.785,-196.36"/> | |
<polygon fill="black" stroke="black" points="201.614,-193.361 191.479,-190.274 197.477,-199.007 201.614,-193.361"/> | |
<text text-anchor="middle" x="250.5" y="-214.8" font-family="Times,serif" font-size="14.00">push</text> | |
</g> | |
<!-- localMaster1->localBranchDelete --> | |
<!-- localBranch0->localBranch0 --> | |
<g id="edge16" class="edge"><title>localBranch0->localBranch0</title> | |
<path fill="none" stroke="black" d="M320.27,-443.863C332.076,-444.076 341.747,-441.455 341.747,-436 341.747,-432.25 337.176,-429.839 330.482,-428.768"/> | |
<polygon fill="black" stroke="black" points="330.466,-425.26 320.27,-428.137 330.035,-432.247 330.466,-425.26"/> | |
<text text-anchor="middle" x="356.247" y="-432.3" font-family="Times,serif" font-size="14.00">work</text> | |
</g> | |
<!-- localBranch1 --> | |
<g id="node12" class="node"><title>localBranch1</title> | |
<ellipse fill="lightgrey" stroke="black" cx="288" cy="-349" rx="35.9954" ry="18"/> | |
<text text-anchor="middle" x="288" y="-345.3" font-family="Times,serif" font-size="14.00">branch</text> | |
</g> | |
<!-- localBranch0->localBranch1 --> | |
<!-- localBranch0->localBranch1 --> | |
<g id="edge17" class="edge"><title>localBranch0->localBranch1</title> | |
<path fill="none" stroke="black" d="M288,-417.799C288,-406.163 288,-390.548 288,-377.237"/> | |
<polygon fill="black" stroke="black" points="291.5,-377.175 288,-367.175 284.5,-377.175 291.5,-377.175"/> | |
<text text-anchor="middle" x="309.5" y="-388.8" font-family="Times,serif" font-size="14.00">commit</text> | |
</g> | |
<!-- localBranch1->forkBranch1 --> | |
<g id="edge18" class="edge"><title>localBranch1->forkBranch1</title> | |
<path fill="none" stroke="black" d="M252.176,-349C240.87,-349 228.215,-349 216.287,-349"/> | |
<polygon fill="black" stroke="black" points="216.045,-345.5 206.045,-349 216.045,-352.5 216.045,-345.5"/> | |
<text text-anchor="middle" x="229" y="-355.8" font-family="Times,serif" font-size="14.00">push</text> | |
</g> | |
<!-- localBranch1->localMaster1 --> | |
<!-- start --> | |
<g id="node14" class="node"><title>start</title> | |
<polygon fill="none" stroke="black" points="57,-635 19.1282,-617 57,-599 94.8718,-617 57,-635"/> | |
<polyline fill="none" stroke="black" points="29.9663,-622.151 29.9663,-611.849 "/> | |
<polyline fill="none" stroke="black" points="46.1619,-604.151 67.8381,-604.151 "/> | |
<polyline fill="none" stroke="black" points="84.0337,-611.849 84.0337,-622.151 "/> | |
<polyline fill="none" stroke="black" points="67.8381,-629.849 46.1619,-629.849 "/> | |
<text text-anchor="middle" x="57" y="-613.3" font-family="Times,serif" font-size="14.00">start</text> | |
</g> | |
<!-- start->upstreamMaster0 --> | |
<g id="edge11" class="edge"><title>start->upstreamMaster0</title> | |
<path fill="none" stroke="black" d="M57,-598.696C57,-585.46 57,-566.947 57,-551.663"/> | |
<polygon fill="black" stroke="black" points="60.5001,-551.227 57,-541.227 53.5001,-551.227 60.5001,-551.227"/> | |
</g> | |
</g> | |
</svg> |
I've resolved the problems with placement and representation of branch deletion in the fork and local copies.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not positive that the fork branch deletion is represented properly. For one thing, it should be shown to come after the branch and the upstream master have been merged. I'm not sure how to indicate that neatly and without making the graph taller. I don't like how the deletion is shown graphically, either.