Hi, Thanks Philip. However, I made several tests. And always after git fetch --dry-run echo $? I get 0. I get 0 when I am far beyond the latest git commit, and also when I am on the latest git commit.
So I am not sure how to check this via a bash script. Regards, Kevin On Sat, Jun 11, 2016 at 8:30 PM, Philip Oakley <[email protected]> wrote: > From: "Kevin Wilson" <[email protected]> >> >> Hello, git users, >> >> I have a bash script which runs python application which resides in a git >> repo. >> >> You clone that repo and the bash script has one line which runs the >> main python script. It works ok. >> >> Now, I want to be able to find out, when running that script, whether >> the current tree was updated in the repo >> or not, and give the user the option to device whether he want not to >> run the script anyway, or to stop. >> >> Is there a git command which will do it ? of course I don't want to >> use git pull or git fetch, as I want to let the >> user decide whether he wants to run the script anyhow. >> > > Try > http://stackoverflow.com/questions/7938723/git-how-to-check-if-a-local-repo-is-up-to-date/7939193#7939193 > (and the other answers..) > > git fetch --dry-run > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
