GitGraph: Add more example diagrams to test with.

This commit is contained in:
Guy Pursey 2023-10-07 18:43:16 +01:00
parent d9daf19055
commit 839645f161

View File

@ -17,27 +17,89 @@
<h1>Git diagram demo</h1> <h1>Git diagram demo</h1>
<pre class="mermaid"> <pre class="mermaid">
--- ---
title: Simple Git diagram title: Simple "branch and merge"
--- ---
gitGraph: gitGraph:
options
{
"nodeSpacing": 50,
"nodeRadius": 5
}
end
branch master
commit commit
branch newbranch branch newbranch
checkout newbranch checkout newbranch
commit commit
commit checkout main
checkout master
commit
commit
merge newbranch merge newbranch
</pre> </pre>
<pre class="mermaid">
---
title: Continuous development
---
gitGraph:
commit
branch develop
checkout develop
commit
checkout main
merge develop
checkout develop
commit
checkout main
merge develop
</pre>
<pre class="mermaid">
---
title: Two-way merges
---
gitGraph:
commit
branch develop
checkout develop
commit
checkout main
merge develop
commit
checkout develop
merge main
commit
checkout main
merge develop
</pre>
<pre class="mermaid">
---
title: Cherry-pick
---
gitGraph:
commit
branch newbranch
checkout newbranch
commit id: "Pick me"
checkout main
commit
checkout newbranch
commit
checkout main
cherry-pick id: "Pick me"
merge newbranch
</pre>
<pre class="mermaid">
---
title: Three branches
---
gitGraph:
commit
branch develop
checkout develop
commit
branch feature
checkout feature
commit
checkout main
merge feature id:"Direct to main"
checkout develop
merge feature
commit
checkout main
merge develop
</pre>
<script type="module"> <script type="module">
import mermaid from './mermaid.esm.mjs'; import mermaid from './mermaid.esm.mjs';
const ALLOWED_TAGS = [ const ALLOWED_TAGS = [