Created
March 30, 2016 09:11
-
-
Save bicpi/f275a4e215b717011197cbae9ddcd23a to your computer and use it in GitHub Desktop.
This shell function is a hack to run git commands silently, e.g. for usage within build scripts
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
quiet_git() { | |
stdout=$(tempfile) | |
stderr=$(tempfile) | |
if ! git "$@" </dev/null >$stdout 2>$stderr; then | |
cat $stderr >&2 | |
rm -f $stdout $stderr | |
exit 1 | |
fi | |
rm -f $stdout $stderr | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment