I have many new files as well as some modified files that I added to my branch, and when I do git difftool master
it diffs all modified files as well as opening up for all new files. I see things like
Launching WinMergeU.exe: /dev/null src/example1.cpp
It is rather annoying since it is somewhat pointless to looking at a diff of new files.
Is there a way to only have Git diff the modified files and ignore new files?
git difftool is a Git command that allows you to compare and edit files between revisions using common diff tools. git difftool is a frontend to git diff and accepts the same options and arguments.
I just tested this answer, and it appears to work equally well with difftool
.
git difftool --diff-filter=M
Just adding to the answer of Merlin2011 :)
You are looking for --diff-filter=M
to show only files M
odified between the two branches.
From man git-diff
--diff-filter=[ACDMRTUXB*]
Select only files that are
A Added
C Copied
D Deleted
M Modified
R Renamed
T have their type (mode) changed
U Unmerged
X Unknown
B have had their pairing Broken
* All-or-none
Any combination of the filter characters may be used.
When *
(all-or-none) is added to the combination, all paths are selected if there is any file that matches other criteria in the comparison; if there is no file that matches other criteria, nothing is selected.
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