更新时间:2021-07-30 04:55:01
感谢Ivan.
他的命令解决了我的问题.我只需要在xargs上添加"-r"参数即可对空的greps做出反应:
His command solved my Problem. I only had to add the "-r" parameter to xargs to react on empty greps:
git show-ref | cut -d' ' -f2 | grep 'pull-request' | xargs -r -L1 git update-ref -d