I have a local git repo, and I have a remote git repo. What is a simple command to see what commit the remote repo is, and what commit the local repo is, so I can simple see if I’m up to date?
This is going to be automated in a program, so I don’t want lots of complicated stuff that I would have to parse. Preferably it would be cool to have both local & remote output the same text, with only the commit changing between the two. Any ideas?
Assuming that your remote repository is referred to by the remote
origin, and you’re interested in the branchmaster, you can do:And then compare the output of:
… and:
If the object names that are output by those two commands are the same, then your
masterand themasterinoriginwere the same at the point when thegit fetch originwas run.