Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 使用xargs在git alias中显示命令_Bash_Git_Xargs - Fatal编程技术网

Bash 使用xargs在git alias中显示命令

Bash 使用xargs在git alias中显示命令,bash,git,xargs,Bash,Git,Xargs,我的.gitconfig中有以下“push all”别名: [alias] pall = !git remote | xargs -L1 -I R git push R 这使我可以在所有遥控器上使用 git pall master 有了3个遥控器,我的输出看起来像 Everything up-to-date Everything up-to-date Everything up-to-date 我正在寻找一种让命令显示实际执行内容的方法。差不多 git push remote1 m

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

[alias]
    pall = !git remote | xargs -L1 -I R git push R
这使我可以在所有遥控器上使用

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美元那么简单。如何修改我的别名,使其执行后的输出能够解释如上所示的情况?

我认为您可能需要使用
-t
运行
xargs

在执行之前立即将要执行的命令回显为标准错误


有没有办法让执行的命令脱颖而出?例如,通过突出显示它们或缩进它们的输出?
$ 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