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

Re: how to update origin/<branch> after a push to origin <branch>?

From
Avery Pennarun <apenwarr@gmail.com>
Date
May 14, 2009, 05:29 UTC
Message-ID
<32541b130905132229nf873a39m4b7c93e3bac0f39c@mail.gmail.com>
In-Reply-To
<20329.1242278469@relay.known.net>
On Thu, May 14, 2009 at 1:21 AM, layer <layer@known.net> wrote:
Show 10 quoted lines
> Avery Pennarun <apenwarr@gmail.com> wrote:
>>> Short answer:
>>>
>>>    git fetch origin
>
> I wasn't doing exactly this, but I was doing the equivalent of
>
>  git fetch $(git config --get remote.origin.url)
>
> Why would these be different?

If you fetch only based on URL, then git doesn't know the name of that url is 'origin', and thus can't possibly know that it's supposed to replace origin/master.

BTW, the reason 'git fetch origin master' doesn't work is completely unrelated: in *that* case, that syntax means you want to fetch the branch named master, but you're going to do something specific to it, so it ends up being stored as FETCH_HEAD instead. Generally you don't want to use that syntax.

Avery
Previous: layer
Message 6 of 6 in “how to update origin/<branch> after a push to origin <branch>?”
  1. layerMay 14, 2009
  2. Avery PennarunMay 14, 2009
  3. layerMay 14, 2009
  4. layerMay 14, 2009
  5. layerMay 14, 2009
  6. Avery PennarunMay 14, 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.