I have a sample HTML file sitting in git. Recently it needs to be changed completely, so there isn’t much point looking at the diff between the new and the old.
Currently the diff will display like ++-+–+–+—++, and I want it to just display ——–+++++++.
Is there a way to tell git that this file change is a complete change and users does not need to know line differences, but change as a whole?
P.S. the answer showed the way in diff command, but but it would be great if I can specify permanently this for specific file in commit command.
Every commit in git stores a completely new blob for the file, even if the change was a single character change in a text file ( later on it might be packed with just delta etc. )
And you should generally not be worried about how and what git stores ( and disk space is cheap)
Update:
If you are just worried about the diff that you see when a file is rewritten, you can use the -B option with diff:
There are more complex methods like using filter-branch etc to remove ( and modify) history, but I won’t recommend those in this case.