git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Angelo Borsotti <angelo.borsotti@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: git fetch documentation problem or bug
Date: Mon, 08 Oct 2012 12:18:25 -0700	[thread overview]
Message-ID: <7vbogclqm6.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vfw5olqp9.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Mon, 08 Oct 2012 12:16:34 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Angelo Borsotti <angelo.borsotti@gmail.com> writes:
>
>> git fetch <repository> <refspec> does not create the remote refs in
>> the current (local)
>> repository...
>> However, if a git fetch origin is executed, the refs are properly created:
>
> Working as designed and documented.
>
>  $ git fetch origin master
>
> is giving the refspec "master" from the command line which is a
> short-hand for "refs/heads/master".
>
> When you run
>
>  $ git fetch origin
>
> configured refspec is looked up from your config (because you didn't
> give any from the command line).  The default refspec in your config
> is likely to be "refs/heads/*:refs/remotes/origin/*".
>
> The former, "refs/heads/master" refspec, tells Git not to update the
> remote tracking branch.  The latter has colon and right-hand-side of
> the colon tells Git what to update with what was fetched.
>
> It would hlep to read up on refspec by running "git fetch --help"
> and looking for a string "colon".

Addendum.  Your claim

>> git fetch <repository> <refspec> does not create the remote refs in
>> the current (local)
>> repository...

is incorrect.  The behaviour depends on what <refspec> you give.

In other words, you can do this from the command line if you want
to do the update.

  $ git fetch origin master:refs/remotes/origin/master

  reply	other threads:[~2012-10-08 19:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 18:59 git fetch documentation problem or bug Angelo Borsotti
2012-10-08 19:16 ` Junio C Hamano
2012-10-08 19:18   ` Junio C Hamano [this message]
2012-10-08 23:33     ` Junio C Hamano
2012-10-09  1:57       ` Nguyen Thai Ngoc Duy
2012-10-21 12:15       ` Drew Northup
2012-10-21 19:30         ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vbogclqm6.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=angelo.borsotti@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).