From 5f6546f775c7be21adb8aecb52d7c70cd9dc6357 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 7 Oct 2020 18:03:05 +0100 Subject: [PATCH] Add note about rebasing --- notes/git/rebase-onto.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 notes/git/rebase-onto.md diff --git a/notes/git/rebase-onto.md b/notes/git/rebase-onto.md new file mode 100644 index 0000000..b3f8dca --- /dev/null +++ b/notes/git/rebase-onto.md @@ -0,0 +1,12 @@ +--- +title: Rebase commits done on the wrong branch +tags: + - Git +link: https://git-scm.com/book/en/v2/Git-Branching-Rebasing#_more_interesting_rebases +--- + +```sh +git rebase --onto master server client +``` + +> Take the `client` branch, figure out the patches since it diverged from the `server` branch, and replay these patches in the client branch as if it was based directly off the `master` branch instead.