使用 xargs 在 git 别名中显示命令

Showing commands in git alias using xargs

我的 .gitconfig 中有以下 "push all" 别名:

[alias]
    pall = !git remote | xargs -L1 -I R git push R

这让我可以使用

在所有遥控器上推送到 master
git pall master

对于 3 个遥控器,这给了我一个看起来像

的输出
Everything up-to-date
Everything up-to-date
Everything up-to-date

我正在寻找一种方法让命令显示实际执行的内容。像

git push remote1 master
    Everything up-to-date
git push remote2 master
    Everything up-to-date
git push remote3 master
    Everything up-to-date

虽然我不确定如何访问分支参数。不像 1 美元那么简单。我如何修改我的别名以便执行它会产生一个输出,解释发生了什么,如上所示?

我想你可能需要 运行 xargs-t:

Echo the command to be executed to standard error immediately before it is executed.

$ seq 10 | xargs -t -I x echo "n=x"
echo n=1
n=1
echo n=2
n=2
echo n=3
n=3
echo n=4
n=4
echo n=5
n=5
echo n=6
n=6
echo n=7
n=7
echo n=8
n=8
echo n=9
n=9
echo n=10
n=10