Jeff Sheltren: git rebase --onto - The simple 1 min explanation

News - NETCreator - 2018-04-17 13:30:44

TL;DR the command you want is: git rebase --onto [the new HEAD base] [the old head base - check git log] [the-branch-to-rebase-from-one-base-to-another] And my main motivation to putting it here is to easily find it again in the future as I always forget the syntax. Mental model To make all of this simpler think of: You have: Two red dishes on top of two blue dishes One yellow dish You want: Those two red dishes on top of the one yellow dish You do: Carefully go with the finger down to the bottom of the two red dishes, which is the first blue dish Take the two red dishes Transfer them over to the one yellow dish That is what rebase --onto does: git rebase --onto [yellow dish] [from: first blue dish] [the two red dishes] Note: The following is meant for an intermediate audience that is familiar with general rebasing in GIT Longer explanation It happened! A branch you had been based your work on has diverged upstream, but you still have work in progress you want to preserve. So it looks like this for you: "Your Commit A" - "Your Commit B" - "Upstream Commit: This is the...
fabian Tue, 04/17/2018 - 02:24
Source: Fedora
Latest Posts
NETCreator CMS

Search
Free Hosting