Search code examples
gitgit-log

How to update the display of remote hash in git log?


If I type git log, I get a list of hashes with associated info (date, committer, log message..). If I'm on the main branch, and so are all my remotes, then if a remote currently has main at a given hash, then next to the hash it displays the remote name. (It might be different than my local main because I haven't pushed my main to a particular remote. In particular, if git is used to deploy, I may purposely have changes not yet deployed.)

I am noticing that this display is out of date since someone else pushed to a couple of the remotes. That is, the remotes are showing on hashes that are not really true when I examine the remote via the web.

How do I update my git log display so I can see which hash each remote is really on?

P.S. This may be a duplicate of some other question, but I've been searching "git log remote show hash" and the like, and it brings up other topics. Perhaps I don't know the precise terminology.


Solution

  • Ah, I think I found the answer.

    The display of where a remote is in the git log output is driven by git refs, and the way to update that display for a particular remote is git fetch remote-name for each remote I want to update.