git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Lambda <tom.lambda@gmail.com>
To: git@vger.kernel.org
Subject: Question regarding git fetch
Date: Thu, 27 Aug 2009 10:30:45 -0500 (CDT)	[thread overview]
Message-ID: <1251387045053-3527289.post@n2.nabble.com> (raw)


I noticed that git-fetch seems smarter when it is run without a <refspec>
argument than when one specifies a branch name. I use a simple setup where a
remote central repository is defined when it is cloned the first time (clone
-o central ...). This leads to these default parameters:

remote.central.fetch=+refs/heads/*:refs/remotes/central/*
branch.master.remote=central
branch.master.merge=refs/heads/master

When I use "git fetch central" each branch in central's refs/heads/ is
automatically fetched to my refs/remotes/central/ as expected.

What was a little bit surprising to me is that running "git fetch central
master" does not update refs/remotes/central/master but simply updates
FETCH_HEAD.

I read the manual and I know that updating FETCH_HEAD is the expected
default behavior for git-fetch. However, I really like the fact that git
fetch (without <refspec>) knows that ANY branch in refs/heads/ corresponds
to refs/remotes/central/. Is there a way to change the configuration to have
"git fetch central branch" always updating refs/remotes/central/branch
whatever the specified branch.

I would prefer not to have to specify the <dst> each time:
git fetch central branch:remotes/central/branch

Thank you,
Tom

-- 
View this message in context: http://n2.nabble.com/Question-regarding-git-fetch-tp3527289p3527289.html
Sent from the git mailing list archive at Nabble.com.

             reply	other threads:[~2009-08-27 15:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27 15:30 Tom Lambda [this message]
2009-08-27 15:36 ` Question regarding git fetch Avery Pennarun
2009-08-27 16:21   ` Eric Raible
2009-08-27 16:28     ` Avery Pennarun
2009-08-27 16:46   ` Björn Steinbrink
2009-08-27 17:22     ` Avery Pennarun
2009-08-27 20:48       ` Jeff King
2009-08-27 21:34         ` Jeff King
2009-08-27 21:44           ` Junio C Hamano
2009-08-27 21:50             ` Jeff King
2009-08-27 21:53               ` Jeff King
2009-08-27 22:12               ` Avery Pennarun
2009-08-27 22:16                 ` Jeff King
2009-08-27 22:24                   ` Avery Pennarun
2009-08-27 21:20   ` Junio C Hamano
2009-08-27 21:39     ` Jeff King
2009-08-28 13:24 ` Tom Lambda

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=1251387045053-3527289.post@n2.nabble.com \
    --to=tom.lambda@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.
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 NNTP newsgroup(s).