git diff で標準出力させて、テキストファイルに保存したいときなどは下記のオプションをつければよい。

git --no-pager diff

 

git --no-pager diff > git_diff.txt

など