Don’t show the untracked files in git status
git status | perl -pe "exit if(/Untracked files\:/)"
Byte sized tech know-how.
Don’t show the untracked files in git status
git status | perl -pe "exit if(/Untracked files\:/)"
Copyright © 2024 Txt
You may find git diff –summary more rewarding.
Aaw come on! Why fire up perl for such a simple task? Just use sed:
git status | sed ‘/Untracked files/q’
Please learn to use the right tools for the right tasks. Perl is _not_ the answer to everything (despite most Perl kids do think so).
mkl – actually, here is a better sed alternative:
git status | sed -n -e’/Untracked files:/q’ -ep
It filters out that last redundant “Untracked Files” line.
I’m new to git and amazed there is not a standard “git status” option to do this?! I use “svn st -q” all the time.
Now you can simply type “git status -uno”
Thanks!