Question

I am issuing these:

git format-patch 2f3e744 2f3e744^ 

or

git format-patch 2f3e744..3e853

In the latter, 3e853 is a commit earlier than 2f3e744.

Neither command resulted in some change (not the result I was expecting).

My goal is to make a patch based on changes from revision 3e853.

Was it helpful?

Solution

You're subject is actually wrong. You're command line is not providing that, it's providing ^2f3e744 3e853, which excludes your commit. The proper way to write this is git format-patch 3e853..2f3e744. You could also do:

  • git format-patch -1 3e853 - Which means take 1 commit starting at 3e853.
  • git format-patch 3e853 '^3e853^' - Which means taken the set the leads up to 3e853, and subtract out everything before it. Note the quotes. Some shells will try to interpret the carets (^), so you may need them.

The git rev-list docs are a good resource for this information.

Update: You're title changed, it's the first example now. And it may not be producing anything because your history is short. I'd expect the first command to emit a patch for everything up to 2f3e744.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top