Search code examples
gitgit-diff

Adding tips to Git to assist with diffs


Git diff often thinks that minor changes are very great changes and does not correctly identify the minor changed code.

Is there a simple way to help git like by adding some marker that is in the source code, or perhaps some other way?


Solution

  • git diff offers various ways to ignore minor changes:

    However, that is for a local diff.
    For GitHub, there is no native solution for forcing it to display a diff when the file is "too large".

    A similar scenario (still on GitHub) was reported here, when seeing

    Sorry, we could not display the entire diff because too many files changed
    

    I'm doing workaround by download the diff file to local, but by that way I don't have the diff highlighting feature like what I got in GitHub PR.

    Adding .patch at the end of the diff GitHub URL can help a bit.