What is special about the output from the git fetch command that prints to the console? I can not use grep , xargs , etc. Unable to redirect output to file.
Note. I use the git fetch --dry-run command
[ 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]$
I am trying to parse the output of the git fetch --dry-run command to check if the local branch ( master ) is current with the remote branch ( origin/master ).
source share