1

I have a patch file generated from git. Is there any possibility to get list of moved (or renamed) files from it? I need this because I want to apply this patch to other version control system and if I do the simple remove/create I will lost all file history.

Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133
Pawel Faron
  • 312
  • 2
  • 9

1 Answers1

0

use -M:

-M[], --find-renames[=] Detect renames. If n is specified, it is a threshold on the similarity index (i.e. amount of addition/deletions compared to the file’s size). For example, -M90% means Git should consider a delete/add pair to be a rename if more than 90% of the file hasn’t changed. Without a % sign, the number is to be read as a fraction, with a decimal point before it. I.e., -M5 becomes 0.5, and is thus the same as -M50%. Similarly, -M05 is the same as -M5%. To limit detection to exact renames, use -M100%.

See: How to do a git diff on moved/renamed file?

Community
  • 1
  • 1
Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133