Git graph demo

Simple "branch and merge" graph

    ---
    title: Simple "branch and merge" (left-to-right)
    ---
    gitGraph LR:
    commit
    branch newbranch
    checkout newbranch
    commit
    checkout main
    merge newbranch
    
    ---
    title: Simple "branch and merge" (top-to-bottom)
    ---
    gitGraph TB:
    commit
    branch newbranch
    checkout newbranch
    commit
    checkout main
    merge newbranch
    

Continuous development graph

    ---
    title: Continuous development (left-to-right)
    ---
    gitGraph LR:
    commit
    branch develop
    checkout develop
    commit
    checkout main
    merge develop
    checkout develop
    commit
    checkout main
    merge develop
    
    ---
    title: Continuous development (top-to-bottom)
    ---
    gitGraph TB:
    commit
    branch develop
    checkout develop
    commit
    checkout main
    merge develop
    checkout develop
    commit
    checkout main
    merge develop
    

Two-way merges

    ---
    title: Two-way merges (left-to-right)
    ---
    gitGraph LR:
    commit
    branch develop
    checkout develop
    commit
    checkout main
    merge develop
    commit
    checkout develop
    merge main
    commit
    checkout main
    merge develop
    
    ---
    title: Two-way merges (top-to-bottom)
    ---
    gitGraph TB:
    commit
    branch develop
    checkout develop
    commit
    checkout main
    merge develop
    commit
    checkout develop
    merge main
    commit
    checkout main
    merge develop
    

Cherry-pick from branch graph

    ---
    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"
    
    ---
    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"
    

Cherry-pick from main graph

    ---
    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"
    
    ---
    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"
    

Cherry-pick then merge graph

    ---
    title: Cherry-pick then merge (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"
    merge newbranch
    
    ---
    title: Cherry-pick then merge (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"
    merge newbranch
    

Merge from main graph

    ---
    title: Merge from main (left-to-right)
    ---
    gitGraph LR:
    commit
    branch develop
    commit
    checkout main
    commit id:"A"
    checkout develop
    commit
    merge main
    
    ---
    title: Merge from main (top-to-bottom)
    ---
    gitGraph TB:
    commit
    branch develop
    commit
    checkout main
    commit id:"A"
    checkout develop
    commit
    merge main
    

Three branches graph

    ---
    title: Three branches (left-to-right)
    ---
    gitGraph LR:
    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
    
    ---
    title: Three branches (top-to-bottom)
    ---
    gitGraph TB:
    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