These are the Mermaid versions of the diagrams I created for my https://stackoverflow.com/q/68229841/1800052 question.
gitGraph
commit
commit id: "A"
branch feature1
commit id: "B"
commit id: "C"
checkout main
commit id: "D"
checkout feature1
branch feature2
commit id: "E"
commit id: "F"
checkout main
merge feature1 id: "G" tag: "merge --squash"
checkout feature2
merge main id: "H" tag: "merge"
gitGraph
commit
commit id: "A"
branch feature1
commit id: "B"
commit id: "C"
checkout main
commit id: "D"
checkout feature1
branch feature2
commit id: "E"
commit id: "F"
checkout main
merge feature1 id: "G" tag: "merge --squash"
checkout feature1
merge main id: "G'" tag: "merge"
checkout feature2
merge feature1 id: "H'" tag: "merge"