Created
July 9, 2015 04:16
-
-
Save jensendarren/e5614e19db0dcf96fa44 to your computer and use it in GitHub Desktop.
Git diff which includes new files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if test "$#" = 0; then | |
( | |
git diff | |
git ls-files --others --exclude-standard | | |
while read -r i; do git diff -- /dev/null "$i"; done | |
) | |
else | |
git diff "$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note to get this working, first create a Git Custom Command: 'git-diff-new' by following these steps:
http://thediscoblog.com/blog/2014/03/29/custom-git-commands-in-3-steps/