I have a master branch, and I want to have a script that detects if the remote master has updated. I know I can do this:
git fetch
And now when I run
git diff master origin/master
I get input.
The question is, is the best way to detect this in a script is to analyze the textual output? Feels not so stable.. Any ideas?