Skip to content

Instantly share code, notes, and snippets.

@bryanchriswhite
Created January 10, 2024 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryanchriswhite/fd2f9f83eff8d05ab99757aa689682fe to your computer and use it in GitHub Desktop.
Save bryanchriswhite/fd2f9f83eff8d05ab99757aa689682fe to your computer and use it in GitHub Desktop.
gitGraph
    commit
    commit
    branch FeatureA
    commit
    commit
    branch FeatureAB
    commit id: "AB1"
    commit id: "AB2"
    checkout main
    commit
    commit
    checkout FeatureA
    merge main
    checkout FeatureAB
    merge FeatureA
    commit id: "AB3"
    checkout main
    commit id: "FeatureA (squash)" type: HIGHLIGHT
    checkout FeatureAB
    merge main
    commit id: "AB4"
git fetch origin && git checkout origin/main # fresh off remote main
git checkout -b FeatureAB-cherry-pick
git cherry-pick `git rev-list --reverse --no-merges --first-parent AB1^..FeatureAB`
gitGraph
    commit
    commit
    commit id: "FeatureA (squash-merge)" type: HIGHLIGHT
    branch FeatureAB-cherry-pick
    commit id: "AB1"
    commit id: "AB2"
    commit id: "AB3"
    commit id: "AB4"
    checkout main
    commit
    commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment