Consider a very big changeset. Upon doing git show <sha1>, you get changes related to all files. But I am interested only in changes made to .cpp files, rest files are not useful for my analysis. 
How can I filter them out of git show result? 
Any command or option.
git show -- *.cpp works. Without --, the glob seems unable to work properly. 
Answer given by @ElipieKay in comment section worked for me.
Prints file names having .cpp extension.
git show --name-status 29a9f891fd -- *.cpp      
Display the changes done to files with .cpp extension.
git show 29a9f891fd -- *.cpp
                        You can filter the diff which git show outputs by providing paths or patterns to match. So in your case:
git show "*.cpp"
You need to use the appropriate quoting for your shell to ensure that Git sees the wildcard (*.cpp) and that it isn't expanded by you shell first.
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