To find out what some other Git repository's HEAD is, use git ls-remote:
$ git ls-remote --symref origin HEAD
ref: refs/heads/master HEAD
670b81a890388c60b7032a4f5b879f2ece8c4558 HEAD
This assumes both your Git, and the remote's Git, are not so old that they do not support --symref (it must be supported on both sides). Note that this command can be run outside any repository by using a URL directly, instead of a remote name like origin.
To find out what branch names exist in some other Git repository, either clone it and inspect the resulting remote-tracking names, or use git ls-remote. Note that you can specify just refs/heads to limit the output to branch names only, or omit it entirely to get everything (all branch and tag names and any other names they choose to expose).