mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-04 21:04:12 +01:00
GitGraph: Added cherry-pick and merge demos for to GitGraph.
This commit is contained in:
@@ -78,7 +78,7 @@
|
|||||||
---
|
---
|
||||||
title: Two-way merges (left-to-right)
|
title: Two-way merges (left-to-right)
|
||||||
---
|
---
|
||||||
gitGraph:
|
gitGraph LR:
|
||||||
commit
|
commit
|
||||||
branch develop
|
branch develop
|
||||||
checkout develop
|
checkout develop
|
||||||
@@ -110,10 +110,72 @@
|
|||||||
checkout main
|
checkout main
|
||||||
merge develop
|
merge develop
|
||||||
</pre>
|
</pre>
|
||||||
<h2>Simple "cherry-pick" graph</h2>
|
<h2>Cherry-pick from branch graph</h2>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
---
|
---
|
||||||
title: Cherry-pick (left-to-right)
|
title: Cherry-pick from branch (left-to-right)
|
||||||
|
---
|
||||||
|
gitGraph LR:
|
||||||
|
commit
|
||||||
|
branch newbranch
|
||||||
|
checkout newbranch
|
||||||
|
commit id: "Pick me"
|
||||||
|
checkout main
|
||||||
|
commit
|
||||||
|
checkout newbranch
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
cherry-pick id: "Pick me"
|
||||||
|
</pre>
|
||||||
|
<pre class="mermaid">
|
||||||
|
---
|
||||||
|
title: Cherry-pick from branch (top-to-bottom)
|
||||||
|
---
|
||||||
|
gitGraph TB:
|
||||||
|
commit
|
||||||
|
branch newbranch
|
||||||
|
checkout newbranch
|
||||||
|
commit id: "Pick me"
|
||||||
|
checkout main
|
||||||
|
commit
|
||||||
|
checkout newbranch
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
cherry-pick id: "Pick me"
|
||||||
|
</pre>
|
||||||
|
<h2>Cherry-pick from main graph</h2>
|
||||||
|
<pre class="mermaid">
|
||||||
|
---
|
||||||
|
title: Cherry-pick from main (left-to-right)
|
||||||
|
---
|
||||||
|
gitGraph LR:
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
commit id:"A"
|
||||||
|
checkout develop
|
||||||
|
commit
|
||||||
|
cherry-pick id: "A"
|
||||||
|
</pre>
|
||||||
|
<pre class="mermaid">
|
||||||
|
---
|
||||||
|
title: Cherry-pick from main (top-to-bottom)
|
||||||
|
---
|
||||||
|
gitGraph TB:
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
commit id:"A"
|
||||||
|
checkout develop
|
||||||
|
commit
|
||||||
|
cherry-pick id: "A"
|
||||||
|
</pre>
|
||||||
|
<h2>Cherry-pick then merge graph</h2>
|
||||||
|
<pre class="mermaid">
|
||||||
|
---
|
||||||
|
title: Cherry-pick then merge (left-to-right)
|
||||||
---
|
---
|
||||||
gitGraph LR:
|
gitGraph LR:
|
||||||
commit
|
commit
|
||||||
@@ -130,7 +192,7 @@
|
|||||||
</pre>
|
</pre>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
---
|
---
|
||||||
title: Cherry-pick (top-to-bottom)
|
title: Cherry-pick then merge (top-to-bottom)
|
||||||
---
|
---
|
||||||
gitGraph TB:
|
gitGraph TB:
|
||||||
commit
|
commit
|
||||||
@@ -145,6 +207,35 @@
|
|||||||
cherry-pick id: "Pick me"
|
cherry-pick id: "Pick me"
|
||||||
merge newbranch
|
merge newbranch
|
||||||
</pre>
|
</pre>
|
||||||
|
<h2>Merge from main graph</h2>
|
||||||
|
<pre class="mermaid">
|
||||||
|
---
|
||||||
|
title: Merge from main (left-to-right)
|
||||||
|
---
|
||||||
|
gitGraph LR:
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
commit id:"A"
|
||||||
|
checkout develop
|
||||||
|
commit
|
||||||
|
merge main
|
||||||
|
</pre>
|
||||||
|
<pre class="mermaid">
|
||||||
|
---
|
||||||
|
title: Merge from main (top-to-bottom)
|
||||||
|
---
|
||||||
|
gitGraph TB:
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
commit
|
||||||
|
checkout main
|
||||||
|
commit id:"A"
|
||||||
|
checkout develop
|
||||||
|
commit
|
||||||
|
merge main
|
||||||
|
</pre>
|
||||||
<h2>Three branches graph</h2>
|
<h2>Three branches graph</h2>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user