Andy Zhang wrote: > why "git rebase" searching the duplicate patches in <upstream branch> > rather than in <new base branch>? > > hi, all: > > I am reading the help of "git rebase", it says: > "If the upstream branch already contains a change you have made > (e.g., because you mailed a patch which was applied upstream), then > that commit will be skipped. " > > But, because we are applying commits to <new base branch> rather than > to <upstream branch>, I really don't understand why we are searching > the duplicate patches in <upstream branch> rather than in <new base > branch>? > > In the following example, the git command is as: > git rebase --onto master next topic > > I think it should be reasonable to search the duplicate patches in > <new base branch>(i.e, master) instead of <next branch>. My understanding is that only applies when --onto is not specified: git rebase master topic In this case "master" is both the new base, and upstream, and it's in this case where duplicates are skipped. If you specify --onto master, then this isn't done. -- Felipe Contreras