git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How can I tell if a file has been updated upstream?

From
Nicolas Pitre <nico@fluxnic.net>
Date
Feb 5, 2010, 17:39 UTC
Message-ID
<alpine.LFD.2.00.1002051235000.1681@xanadu.home>
In-Reply-To
<ed82fe3e1002050856v68d4d02bnbe18394bebac2f4d@mail.gmail.com>
On Fri, 5 Feb 2010, Timur Tabi wrote:
Show 9 quoted lines
> So maybe you meant this:
> 
> $ git ls-remote ssh://git.am.freescale.net/git/timur/bin refs/heads/master
> 20fbe12069038057cbd0d66c5a673956f7792c7d	refs/heads/master
> 
> I can use this to compare with the local HEAD.  However, this only
> tells me that the repository as a whole has changed.  I was hoping
> there would be a way to see if just the one file has change.  I.e. how
> can I get the HEAD of a *file* in a remote repository.
You can't.

You must perform a fetch and then use whatever method to compare with origin/master:foobar.py which is the file you're looking for.

> Yeah, I'm not keen on performing an actual download, even if it's just a fetch.

Why? It is not like if a fetch was terribly more costly than any method that could get the version of a file on the remote.

Nicolas
Previous: Timur TabiNext: Junio C Hamano
Message 4 of 7 in “How can I tell if a file has been updated upstream?”
  1. Timur TabiFeb 5, 2010
  2. Shawn O. PearceFeb 5, 2010
  3. Timur TabiFeb 5, 2010
  4. Nicolas PitreFeb 5, 2010
  5. Junio C HamanoFeb 5, 2010
  6. Timur TabiFeb 5, 2010
  7. Timur TabiFeb 26, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.