Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git- create a patch between most recent commit and original commit

Tags:

git

I'm preparing to submit my first patch to an open source project. Here's how the process went:

  1. Forked project
  2. Created initial revision
  3. Developer asked me to revise
  4. Revised
  5. Accepted and ready to go.

However, when I run git format-patch HEAD^, I get a diff between my two commits, which obviously doesn't work. Basically, how do I merge the two most recent commits with the project when it was forked, or something like that?


1 Answers

You need to use range

The …​ (three-dot) Symmetric Difference Notation

A similar notation r1...r2 is called symmetric difference of r1 and r2 and is defined as r1 r2 --not $(git merge-base --all r1 r2). It is the set of commits that are reachable from either one of r1 (left side) or r2 (right side) but not from both.

So in this case it would be:

git format-patch ...master
like image 138
Hauleth Avatar answered Oct 19 '25 13:10

Hauleth