2

Trying to move files in a project with git with intellij-idea, the refactor is done by the IDE modifying imports and packages and some files of the project are removed and added again because in GIT there is a percentage of modifications that above it, the files are detected as new.

I would like to modify this percentage no to detect files as new. Is it possible?

4

1 回答 1

5

实际上,Git 移动操作与一步删除和添加相同(更多信息在这里)。

但是,您可以使用git log. 查看git-log(1)手册页中的以下选项:

-M[<n>], --find-renames[=<n>]
   If generating diffs, detect and report renames for each commit. For
   following files across renames while traversing history, see
   --follow. 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%
于 2013-08-14T15:51:22.573 回答