Reputation: 95
We have git configure command running in bash scripts (automation) of which we log the output. it would be very helpful if every git command was verbose rather than peppering the code with echo commands. Is there an option to do this, in general or specifically for git configure?
Upvotes: 1
Views: 626
Reputation: 489808
There isn't one, but you can write a shell function:
# git config <variable> <value>,
# then show the configuration for <variable>
vgitconfig() {
git config "$1" "$2"
echo "git config $1 $2"
}
and then call this function instead of git config
.
The above is quite crude. If you are using complicated settings, you'll need to fancy it up.
Consider also using set -x
, which copies each executed command to an output file (default stderr, tunable in bash).
Upvotes: 1