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

Re: git-fetch remote tag to local branch fails

From
SBSanti Béjar <sbejar@gmail.com>
Date
Jun 24, 2008, 14:27 UTC
Message-ID
<8aa486160806240727r6fc6de6doec8300700293a3a7@mail.gmail.com>
In-Reply-To
<33f4f4d70806240701o1c00cef2g688a188970964b0f@mail.gmail.com>
On Tue, Jun 24, 2008 at 16:01, Klas Lindberg <klas.lindberg@gmail.com> wrote:
Show 9 quoted lines
> Hello
>
>> git tag -l
> foo_tag
> test_tag
>>
>
>> git branch -a
>>
empty?
Show 10 quoted lines
>
> At this point, I can create the branch "b" from "foo_tag", so the
> fetch did get me a remote tag. It just didn't update a local branch
> with the contents (or create a new one).
>
> Something that also confuses me is that if branch "b" already exists, then
>
>> git-pull bogustree refs/tags/foo_tag:refs/heads/b
>
> actually does update branch "b". I find the behaviour quite inconsistent.
You asked explicitly to update branch b with :refs/heads/b.
Show 6 quoted lines
>
> Unfortunately it isn't a solution for me to fetch tags and then create
> branches from the tags. I need to be able to update existing branches,
> and I have to do that without first making such a branch the current
> branch.
>
If you have to update existing branches from remote branches you can:
git fetch <remote> refs/heads/<remotebranch>:refs/heads/<localbranch>

But normally you have some remote tracking branches, such as how the "origin" remote repository is configured.

Updating from remote tags is not normal, since tags are not supposed to change.
Can you explain why you have to do it this way? Or the whole workflow?
Santi
P.D.: Please, do not toppost.
Previous: Klas LindbergNext: Klas Lindberg
Message 4 of 10 in “git-fetch remote tag to local branch fails”
  1. Klas LindbergJun 24, 2008
  2. Santi BéjarJun 24, 2008
  3. Klas LindbergJun 24, 2008
  4. Santi BéjarJun 24, 2008
  5. Klas LindbergJun 24, 2008
  6. Klas LindbergJun 24, 2008
  7. Santi BéjarJun 24, 2008
  8. Klas LindbergJun 25, 2008
  9. Jakub NarebskiJun 25, 2008
  10. Michael J GruberJun 24, 2008

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.