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

Re: git fetch: where are the downloaded objects stored?

From
Nicolas Pitre <nico@cam.org>
Date
Mar 3, 2008, 18:14 UTC
Message-ID
<alpine.LFD.1.00.0803031307380.2899@xanadu.home>
In-Reply-To
<87hcfnu3nu.fsf@osv.gnss.ru>
On Mon, 3 Mar 2008, Sergei Organov wrote:
Show 40 quoted lines
> "Paolo Ciarrocchi" <paolo.ciarrocchi@gmail.com> writes:
> > On Mon, Mar 3, 2008 at 5:29 PM, Nicolas Pitre <nico@cam.org> wrote:
> >> If you have reflog enabled (it should be by default) then a good thing
> >> to remember is the @{1} notation.  For example, if the fetch updated the
> >> origin/master branch, then origin/master@{1} is what your origin/master
> >> was before being updated.  To see the difference between the previous
> >> and the current state of origin/master, you can do:
> >>
> >>        git diff origin/master@{1}..origin/master
> >>
> >> Or to see the list of new commits:
> >>
> >>        git log origin/master@{1}..origin/master
> >>
> >>        git log -p origin/master@{1}..origin/master
> >>
> >> Etc.
> >
> > Very nice, I didn't find in the documentation.
> > I'll read again the documents and if needed, I'll propose some new text.
> >
> >> This notation is a bit obnoxious and the re were suggestions about
> >> addind the equivalent origin/master@{1..} but that didn't materialize
> >> yet.
> >
> > Mybe it's just me but wouldn't be very nice to have a simple command
> > to look at what data have been used for updating the currente branch?
> > i.e.
> > git fetch
> > git diff -- fetch (which is an alias of git diff
> > origin/master@{1}..origin/master)
> >
> > And how about a repository which have reflogs disabled?
> 
> I'm also a newbie, and I think you are on a wrong road. Usually it's not
> that interesting what was downloaded. What is interesting is what is on
> 'origin/master' that is still missing from 'master'. For this I think
> you have:
> 
> $ git log master..origin

Yes, this is indeed what most people should be doing. But if you're tracking some remote repository with no intention of merging them in your master branch by default, then it is often a nice thing to be able to see what has changed in those tracked branches since the last time you fetched them. This is where the reflog is really handy as it records all fetch points you did.

Nicolas
Previous: Sergei OrganovNext: Nicolas Pitre
Message 9 of 12 in “git fetch: where are the downloaded objects stored?”
  1. Paolo CiarrocchiMar 3, 2008
  2. Matthieu MoyMar 3, 2008
  3. Paolo CiarrocchiMar 3, 2008
  4. Matthieu MoyMar 3, 2008
  5. Paolo CiarrocchiMar 3, 2008
  6. Nicolas PitreMar 3, 2008
  7. Paolo CiarrocchiMar 3, 2008
  8. Sergei OrganovMar 3, 2008
  9. Nicolas PitreMar 3, 2008
  10. Nicolas PitreMar 3, 2008
  11. Paolo CiarrocchiMar 3, 2008
  12. Jakub NarebskiMar 3, 2008

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.