0

Consider the following git statement:

git format-patch -M origin/master

Chacon and Straub state in their book "Pro Git", 2.1:

The -M switch tells Git to look for renames.

  1. What does the -M switch do?
  1. In this context, what are "renames"?
SSteven
  • 733
  • 5
  • 17
  • [`git help format-patch`](https://git-scm.com/docs/git-format-patch#Documentation/git-format-patch.txt--Mltngt) – phd Jan 28 '22 at 16:29
  • @phd, Thanks. I had read this before posting, but it is still not clear. – SSteven Jan 28 '22 at 16:33
  • Esp. with question "*what are "renames"?*" – phd Jan 28 '22 at 16:34
  • @phd, _What_ is being renamed? A variable? A constant? – SSteven Jan 28 '22 at 16:39
  • Git doesn't work with variables or constants. Git works with commits and files. Commits cannot be renamed. There are also branches and tags; they can be renamed but they're second-class citizens and are not used with `format-patch`. – phd Jan 28 '22 at 16:43
  • @phd, OK. Therefore, does it mean that _files_ are being renamed and that is what the -M switch identifies? – SSteven Jan 28 '22 at 16:45
  • 1
    Yes. Please read about rename detection: https://stackoverflow.com/a/46258968/7976758 , https://stackoverflow.com/search?q=%5Bgit%5D+rename+detection – phd Jan 28 '22 at 16:49
  • @phd,, Thanks for the clarification. Problem solved. – SSteven Jan 28 '22 at 16:52

0 Answers0