将Git pull命令输出写入文件

时间:2020-03-20 07:33:16

标签: bash shell sh

我无法在文件中编写git pull命令。 我已经尝试运行这些命令,但是没有帮助

git pull --all --dry-run >~/temp1
cat ~/temp1

输出只有一行“ Fetching origin”,其余的输出被转储到命令行中。 我也尝试过

git pull --all --dry-run |tee -a ~/temp1

请帮助我解决该问题。预先感谢

1 个答案:

答案 0 :(得分:0)

尝试将stdoutstderr重定向到文件,类似。

git pull --all --dry-run > ~/temp1 2>&1
相关问题