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

adding/tracking remote branch

From
Nneubyr <neubyr@gmail.com>
Date
Jul 5, 2011, 22:56 UTC
Message-ID
<CALFxCvzNSbxP64zGp93fu=fF9h4eaoUBcyxZUyJFvWSZ3-CUEg@mail.gmail.com>
Hi,

I have a git repository setup with existing remote origin URL. I am trying to add a new remote URL and would like to get this remote's master (or any other) branch in my repository. I tried following commands but it didn't work:

$ git remote add <remote-name> <remote-url> $ git config branch.<branch-name>.remote <remote-name> $ git fetch <remote-name> $ git checkout -b --track <branch-name> refs/remotes/<remote-name>/<remote-branch-name> # here I got branch started from my current working branch and not with remote-branch contents

I appreciate any help on right set of commands here. What am I missing here?

-- neuby.r

Message 1 of 1 in “adding/tracking remote branch”
  1. neubyrJul 5, 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.