How to totally suppress Git Clone output?

2020-04-10 03:16发布

问题:

I am writing a shell script wherein I am doing

log=/var/tmp/git_prod_test_pack/log.out
Time_clone=`(/usr/bin/time -f'%e' git clone --quiet ssh://id@xxxxxxxxxx) 2>&1 >> $log`
echo $Time_clone

It is giving output as Total 104 (delta 0), reused 104 (delta 0) 0.17

How can I totally suppress this output and get only 0.17 ?

回答1:

git clone --quiet https://github.com/dask/dask.git does not produce any output unless you have errors. Your code should work fine, unless you have some bug in the (older) git you use or some weird config of your shell.



标签: git shell