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

Re: How to check new commit availability without full fetch?

From
Nicolas Pitre <nico@fluxnic.net>
Date
Jan 10, 2010, 20:13 UTC
Message-ID
<alpine.LFD.2.00.1001101501520.10143@xanadu.home>
In-Reply-To
<ee2a733e1001100312j786108fct1b4c8abd0acc5afc@mail.gmail.com>
On Sun, 10 Jan 2010, Leo Razoumov wrote:
> Hi List,
> I am trying to find a way to check availability of new commits
> *before* doing fetch or pull. Unfortunately, neither fetch nor pull
> take "--dry-run" option (unlike push)
But... _Why_ do you want/need to do that?

You could use ls-remote to see what the remote branch is pointing to, e.g.:

	git ls-remote origin master
and compare with the local view of that remote branch:
	git show-ref origin/master
And if both SHA1 strings match then there is nothing new to fetch.
> I am sure I am not the only one with such an itch.

Maybe you are. There is very little point knowing that the remote repo has new commits if you're not going to fetch them, so I don't understand why you need this.

Nicolas
Previous: Leo RazoumovNext: Junio C Hamano
Message 2 of 20 in “How to check new commit availability without full fetch?”
  1. Leo RazoumovJan 10, 2010
  2. Nicolas PitreJan 10, 2010
  3. Junio C HamanoJan 10, 2010
  4. Nicolas PitreJan 10, 2010
  5. Leo RazoumovJan 11, 2010
  6. Tay Ray ChuanJan 11, 2010
  7. Junio C HamanoJan 11, 2010
  8. Michael WittenJan 11, 2010
  9. Junio C HamanoJan 11, 2010
  10. Nicolas PitreJan 11, 2010
  11. Leo RazoumovJan 11, 2010
  12. Nicolas PitreJan 11, 2010
  13. Leo RazoumovJan 11, 2010
  14. Dmitry PotapovJan 11, 2010
  15. Robin RosenbergJan 11, 2010
  16. Junio C HamanoJan 11, 2010
  17. Nicolas PitreJan 11, 2010
  18. Junio C HamanoJan 11, 2010
  19. Nicolas PitreJan 11, 2010
  20. Andreas SchwabJan 11, 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.