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

Re: git branch --track to link existing local branch to remote?

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
May 25, 2010, 19:53 UTC
Message-ID
<20100525195303.GA8174@atjola.homenet>
In-Reply-To
<AANLkTinxohzZE6uinzYPIAx3iVjw7afDLsr9MPMUAvHj@mail.gmail.com>
On 2010.05.25 12:40:40 -0700, skillzero@gmail.com wrote:
> However, the branches aren't linked in the config file so I can't just
> do git pull.
[...]
> So what I've had to do is create a temp branch, switch to it, do git
> branch -f --track master origin/master, and then delete the temp
> branch. Is there a better way?

With git v1.7.0 or newer: git branch --set-upstream master origin/master

Björn
Previous: skillzero@gmail.comNext: Michael J Gruber
Message 2 of 4 in “git branch --track to link existing local branch to remote?”
  1. skillzero@gmail.comMay 25, 2010
  2. Björn SteinbrinkMay 25, 2010
  3. completion: --set-upstream option for git-branchMichael J Gruber, May 26, 2010
  4. Joshua JensenMay 25, 2010

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.