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

Re: Question regarding git fetch

From
Avery Pennarun <apenwarr@gmail.com>
Date
Aug 27, 2009, 15:36 UTC
Message-ID
<32541b130908270836m50553ccatddf4c870eec54ddb@mail.gmail.com>
In-Reply-To
<1251387045053-3527289.post@n2.nabble.com>
On Thu, Aug 27, 2009 at 3:30 PM, Tom Lambda<tom.lambda@gmail.com> wrote:
> 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've often wanted this myself, especially when doing things like "git pull origin master". However, I know the current behaviour is also useful sometimes, and changing it would introduce an unexpected side effect. Git currently promises that your refs/remotes/* branches will never be updated unless you explicitly request it, even if you're fetching, merging, and pulling other stuff. This means you can write scripts to do complicated things without triggering unexpected user-visible side effects.

So basically, I agree that it would often be much more user-friendly to do what you're asking. But it would be less scripting-friendly. I don't think anyone has thought of an answer that better balances the two.

Have fun,
Avery
Previous: Tom LambdaNext: Eric Raible
Message 2 of 17 in “Question regarding git fetch”
  1. Tom LambdaAug 27, 2009
  2. Avery PennarunAug 27, 2009
  3. Eric RaibleAug 27, 2009
  4. Avery PennarunAug 27, 2009
  5. Björn SteinbrinkAug 27, 2009
  6. Avery PennarunAug 27, 2009
  7. Jeff KingAug 27, 2009
  8. Jeff KingAug 27, 2009
  9. Junio C HamanoAug 27, 2009
  10. Jeff KingAug 27, 2009
  11. Jeff KingAug 27, 2009
  12. Avery PennarunAug 27, 2009
  13. Jeff KingAug 27, 2009
  14. Avery PennarunAug 27, 2009
  15. Junio C HamanoAug 27, 2009
  16. Jeff KingAug 27, 2009
  17. Tom LambdaAug 28, 2009

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.