I have some img and Illustrator files in my repo but I would like to see all the changes made in my last commit (in the files that contain code only). I run:
git show HEAD
But then, after reviewing a few files, I get this (image below). My question is... how do you skip something like that? This is probably one of the large Illustrator/JPGS file. I would like to go past it and look up the rest of files that contains something with an actual meaning.
I am using git bash console - just so you know.
I know that most of you would say that I should not put large files in the repository in the first place... and you are probably right, but this would not answer my question.
Holding down ENTER for ages and watching screen go green would probably not be the ultimate solution either.
You probably want to force Git to treat those files as binaries by using Git attributes. Put something like this in your .gitattributes file (create it if it doesn't exist):
*.myext binary
See the following post: How do I make Git treat a file as binary?
Try this out:
git show --pretty="format:" --name-only HEAD
It should print the list of files in your last commit.
git diff -- '*.jpg' '*.png'
The quotes are important, list all your required ignored files and it will cont display them
Another option:
git log --cc
you should not add binary files to git.
You have other solution for such a case when you need to add binaries use github LFS for example, git attributes and so on,
Git doesn't treat well binary files so try to avoid it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With