0

I am replacing some files completely from another source. The replacement files are the same exact files, although some contain changes some don't.

Since I replace all files, in the merge request they are all marked as changes, and there is no way to see what actually changed.

Is there any way to commit changes so that git doesn't check that file was deleted/created, but only compares content of the files?

Daemon Painter
  • 3,208
  • 3
  • 29
  • 44
uneasy
  • 547
  • 1
  • 7
  • 17
  • Does this answer your question? [Why does git think each line of an untouched file has changed](https://stackoverflow.com/questions/27438195/why-does-git-think-each-line-of-an-untouched-file-has-changed) – Joe Mar 02 '21 at 10:50
  • Only partially, it only says how to show differences, question was more, how to mark it in commit the same way, not like full file replacement but only what was different in the code. Not sure if I make sense ;) – uneasy Mar 02 '21 at 10:56
  • `git` only tracks file contents. If it's saying the files have all been changed: they have. See that answer to figure out how. – Joe Mar 02 '21 at 10:59
  • yeah I know the whole file was changed, because it was it was copy and pasted and files were overwritten with new files (even if they were the same). So question was about if git can ignore that they were overwritten and just commit the content, but I guess answer is no. and I can only manually check differences – uneasy Mar 02 '21 at 11:05
  • 2
    @uneasy : "copy / paste a file" isn't what makes git detect that a file has changed, git looks at the file's *content*. If a file appears at modified, it means that something within the content of that file has indeed changed. It may be a simple empty line at the end of file, or indentation changing from tabs to spaces, or a change only in spacing, or a change on line endings (between `lf` and `cr lf`), but *something* changed in the files' content. The linked answer provides a way to highlight more explicitly any possible change. – LeGEC Mar 02 '21 at 13:05

0 Answers0