From: Jakub Narebski <jnareb@gmail.com>
To: "Paolo Ciarrocchi" <paolo.ciarrocchi@gmail.com>
Cc: "Matthieu Moy" <Matthieu.Moy@imag.fr>,
"Git Mailing List" <git@vger.kernel.org>
Subject: Re: git fetch: where are the downloaded objects stored?
Date: Mon, 03 Mar 2008 08:59:45 -0800 (PST) [thread overview]
Message-ID: <m3tzjnivzp.fsf@localhost.localdomain> (raw)
In-Reply-To: <4d8e3fd30803030633nf6266d5qab0df4ba4c539e0b@mail.gmail.com>
"Paolo Ciarrocchi" <paolo.ciarrocchi@gmail.com> writes:
> On Mon, Mar 3, 2008 at 2:14 PM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
>> "Paolo Ciarrocchi" <paolo.ciarrocchi@gmail.com> writes:
>>
>>> What is still not clear to me is where git is storing
>>> the objects downloaded during a git fetch operation.
>>
>> git fetch downloads the objects to the object database, i.e.
>> .git/objects/, usualy as a pack.
Downloading as individual objects ("exploded") or as a pack depends on
fetch.unpackLimit configuration.
>> Now, just "having" the objects locally doesn't change much, an object
>> starts being really interesting if you have a reference (typically, a
>> branch) pointing to it. "git fetch" will update the remote references
>> (for example, origin/master), but won't touch the working tree, and
>> won't do any merge, fast-forward or not, to a local branch. So, most
>> likely, "git fetch" will be followed by either a merge or a rebase.
What is important git-fetch _always_ stores what it fetched in
$GIT_DIR/FETCH_HEAD.
Then depending on configuration and command line options it updates
appropriate remote-tracking branches. For example if you do one-shot
"git pull <remote> <branch>" git would not store fetched refs (heads)
in tracking branches: see git-fetch(1).
> Yes, your explanation perfectly match my understanding.
>
> I was, and I'm still, confused by the following sentence in the git merge
> documentation:
>
> "A merge is always between the current HEAD and one or more
> remote branch heads"
This "remote" is here invalid. Merge can merge in any ref, not only
remote-tracking branches. "git merge <branch>" would merge given
branch into current (HEAD) branch:
Before:
1---2---3---4---5---6---7 <-- master <-- HEAD
\
\-A---B <-- devel (or origin/master)
After "git merge devel"
1---2---3---4---5---6---7---M <-- master <-- HEAD
\ /
\-A---B-----/ <-- devel (or origin/master)
where 'M' is merge (multi-parent) commit.
> If I think to the following scenario:
>
> git fetch
> git diff (to look at what I downloaded via git fetch)
Because you download _series_ of commits "git log" would be usually
more useful than "git diff".
You can use <branch>@{1} for position of branch before fetch, or even
ORIG_HEAD for position of HEAD branch before fetch (or pull).
> git merge
I'm not sure if "git merge" without branch specified would work.
"git pull" should, so perhaps "git merge" would too.
"git pull" would merge 'first' branch, or branch specified in
branch/remote configuration.
--
Jakub Narebski
Poland
ShadeHawk on #git
prev parent reply other threads:[~2008-03-03 17:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-03 12:40 git fetch: where are the downloaded objects stored? Paolo Ciarrocchi
2008-03-03 13:14 ` Matthieu Moy
2008-03-03 14:33 ` Paolo Ciarrocchi
2008-03-03 15:21 ` Matthieu Moy
2008-03-03 15:40 ` Paolo Ciarrocchi
2008-03-03 16:29 ` Nicolas Pitre
2008-03-03 16:51 ` Paolo Ciarrocchi
2008-03-03 17:18 ` Sergei Organov
2008-03-03 18:14 ` Nicolas Pitre
2008-03-03 18:07 ` Nicolas Pitre
2008-03-03 19:43 ` Paolo Ciarrocchi
2008-03-03 16:59 ` Jakub Narebski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3tzjnivzp.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=Matthieu.Moy@imag.fr \
--cc=git@vger.kernel.org \
--cc=paolo.ciarrocchi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox