snippets/old_snippets/git-move-branch.en.md

757 B

title date draft snippet_types
move branch 2020-01-11T05:06:49+01:00 false
git
$ git rebase source-commit --onto target-branch

Sometimes you need to start a new feature branch but the place you need to base the branch is not ready yet, say coworker has merged his changes to a stage branch but not master. With this work flow you simply start your branch off stage then move to master later. git branch -m new-name also comes in handy to rename the branch after you've moved it if need be.

source:

makandracards

w3docs