You can't do that in github as far as I know, but you can get git to display diffs that way (eg. for local review or email based workflows). You have to use a git "orderfile". Example:
Github similarly lacks the ability to override the diff algorithm. This is a shame, because `histogram` makes some diffs look much more like what the human intended.
https://gitlab.com/nbdkit/nbdkit/-/blob/master/scripts/git.o...
We found it useful to display header files, interface files and documentation first, but maybe the linked paper will make us review that!