1

Sometimes I remove a JSON file and add another similar JSON file in an entire different path. The files have both around 10 lines. They are only different in 2 lines. If I add the new file & remove the old file in one commit git recognizes this as an move with some changes.

Is there some way to tell git that this wasn't a move?

(Why I want this: I have then a cleaner history & can avoid some merge conflicts)

senden9
  • 336
  • 1
  • 5
  • 16

1 Answers1

1

Git does not store if you move or rename a file, it is actually detected on git show or git log, which you can use --no-renames to turn off the rename detection.

To make sure git always think they are different files, it is best to just remove and add the file in different commits.

Cash Lo
  • 1,052
  • 1
  • 8
  • 20