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

Re: remote branches

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 13, 2011, 09:17 UTC
Message-ID
<AANLkTi=WPAYXg1NCyO+XDw8Jk5v=QBH3nM78CEHytuVQ@mail.gmail.com>
In-Reply-To
<4D578B6D.9090803@inria.fr>
On Sun, Feb 13, 2011 at 08:42, Matthieu Imbert <matthieu.imbert@inria.fr> wrote:
Show 8 quoted lines
> $ git clone
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
> linux-2.6.git
>
> - then i add a remote tracking branch:
>
> $ git remote add --tags drm-intel
> git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel.git

You're adding a remote repository and tracking branches and tags from it.

> - Then i do git fetch or git fetch drm-intel, but nothing happens, and git
> branch -r still only show me origin/HEAD and origin/master, no drm-intel
> branches, though these branches do exist since i can see them with git
> remote -v show drm-intel

You didn't add any remote tracking *branch*, you added a remote and gave it the name "drm-intel". You could just as well do:

    git remote add --tags some-random-name
git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel.git

Also because you specified --tags you're only getting the tags on "git fetch", if you don't do that then:

    $ git fetch some-random-name
    remote: Counting objects: 567, done.
    remote: Compressing objects: 100% (377/377), done.
    remote: Total 488 (delta 371), reused 146 (delta 111)
    Receiving objects: 100% (488/488), 91.42 KiB, done.
    Resolving deltas: 100% (371/371), completed with 53 local objects.
    From git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel
     * [new branch]      drm-intel-fixes -> some-random-name/drm-intel-fixes
     * [new branch]      drm-intel-fixes-2 -> some-random-name/drm-intel-fixes-2
     * [new branch]      drm-intel-next -> some-random-name/drm-intel-next
     * [new branch]      drm-intel-staging -> some-random-name/drm-intel-staging
Which allows you to do:
    $ git checkout --track some-random-name/drm-intel-fixes
    Branch drm-intel-fixes set up to track remote branch
drm-intel-fixes from some-random-name.
    Switched to a new branch 'drm-intel-fixes'
Previous: Matthieu ImbertNext: Matthieu Imbert
Message 2 of 8 in “remote branches”
  1. Matthieu ImbertFeb 13, 2011
  2. Ævar Arnfjörð BjarmasonFeb 13, 2011
  3. Matthieu ImbertFeb 13, 2011
  4. Andreas SchwabFeb 13, 2011
  5. Matthieu ImbertFeb 13, 2011
  6. Björn SteinbrinkFeb 13, 2011
  7. Junio C HamanoFeb 14, 2011
  8. Christian JaegerFeb 16, 2011

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.