'Git `format-patch` returns nothing

I am trying to create a patch for a commit in my repository.

  • System: Windows 10
  • Tools Git Windows Desktop and Git Shell git --version => git version 2.10.1.windows.1

When I try to create the patch I go:

git format-patch master
git format-patch master -o C:\Users\MyUser\Desktop
git format-patch master --stdout > C:\Users\MyUser\Desktop\MyPatch.patch

In all 3 cases, I get nothing. In the first 2 cases, no file is saved in the locations I specify. In the third case, the generated file is 0 bytes.

State of my repository

I have pushed everything to master. So I have no more local unstaged or staged commits. Everything is on the server.

Also, if I change a file and have unstaged changes, still it does not work.

I've also tried:

git format-patch <ccommit-sha>

Using the SHA hash of a commit I pushed. Still does not work.

What am I doing wrong?

git


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source