# adding/tracking remote branch

1 messages from 2011-07-05 to 2011-07-05. Participants: neubyr.
Thread: https://gitlist.dev/t/27759

## neubyr, 2011-07-05 22:56

Subject: adding/tracking remote branch
Message-ID: <CALFxCvzNSbxP64zGp93fu=fF9h4eaoUBcyxZUyJFvWSZ3-CUEg@mail.gmail.com>
URL: https://gitlist.dev/e/CALFxCvzNSbxP64zGp93fu%3DfF9h4eaoUBcyxZUyJFvWSZ3-CUEg%40mail.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

```
