threads / discuss / 27759

adding/tracking remote branch

Subject: adding/tracking remote branch

## tl;dr

One message between Jul 5, 2011 and Jul 5, 2011.

replies: 0people: 1as markdown or json

neubyr· Jul 5, 2011, 22:56 UTC · lore
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

← back to recent threads