git fetch
コンソールに出力されるコマンドの出力メッセージの何が特別なのですか?grep
、などを使用できxargs
ません。出力をファイルにリダイレクトすることもできません。
注:私はgit fetch --dry-run
コマンドを使用しています
[sangeeth@localhost santest-code]$
[sangeeth@localhost santest-code]$ git fetch --dry-run > /tmp/1
From ssh://git.code.sf.net/p/santest/code
9f068d0..2b9dc4e master -> origin/master
[sangeeth@localhost santest-code]$
[sangeeth@localhost santest-code]$ cat /tmp/1 <= no data
[sangeeth@localhost santest-code]$
[sangeeth@localhost santest-code]$ git fetch --dry-run | grep "ssh" <= output has both lines
From ssh://git.code.sf.net/p/santest/code
9f068d0..2b9dc4e master -> origin/master
[sangeeth@localhost santest-code]$
[sangeeth@localhost santest-code]$ git --version
git version 1.7.11.4
[sangeeth@localhost santest-code]$
git fetch --dry-run
コマンドの出力を解析して、ローカル(master
)ブランチがリモート()ブランチで最新であるかどうかを確認しようとしていますorigin/master
。