You can't do that literally.
There are two easy approximations:
- If you can use ssh (or some other accessor) on the remote, you can run
git rev-parse
and evengit rev-list
over there, which gets you as many SHA-1s as you want. - You can use
git ls-remote
to get the head SHA-1s from the remote (includingrefs/heads/master
). All that will tell you is "same" or "different", assuming you have the head SHA-1s locally. If they are different, you can't tell precisely why (though you can get probably-enough if you walk the local revs).
There's something weird about the question, though: you say the local repo is in an encrypted volume to which you do not have the password. If that's so, how do you know what the local heads are, and/or their history? They're recorded inside the repo.