diff - Correct Git replacement of entire file -
i've committed file on git, has several changes, not different old file. rather pick out changes, git has made 1 big delete; whole file, , 1 big insertion; new file. error, there large unchanged sections, e.g. file starts number of "using" statements, none of have changed.
this annoying means i'll lose "blame" history.
is there way make git redo diff? have done cause this? merging branch when happened.
git not store diff, stores version of file tree each commit. diff created git show
not stored in git internal db.
in case, can see file has been renamed if use -m
option of git diff
-m[<n>], --find-renames[=<n>] detect renames. if n specified, threshold on similarity index (i.e. amount of addition/deletions compared file’s size). example, -m90% means git should consider delete/add pair rename if more 90% of file hasn’t changed.
that should trick you.