Skip to content

Instantly share code, notes, and snippets.

@chris-skud
Last active February 3, 2022 21:41
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 chris-skud/30a0be29e7dda381a76325439df2bf3a to your computer and use it in GitHub Desktop.
Save chris-skud/30a0be29e7dda381a76325439df2bf3a to your computer and use it in GitHub Desktop.
Steps to manage a feature branch that has a dependency on another feature branch
A--BC <-- master
\
B--C <-- feature-1
\
D--E <-- feature-2
after feature-1 merges into master, and whilst on feature-2 use:
`git fetch origin`
`git rebase --onto origin/master feature-1`
--onto will tell Git to copy commits D and E (only) with the copies going after commit BC, like this:
D'-E' <-- feature-2 (HEAD)
/
A--BC <-- master
\
B--C <-- feature-1
\
D--E (now abandoned)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment