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

Re: Where/how to create tracking branches?

From
Junio C Hamano <junkio@cox.net>
Date
Feb 19, 2007, 19:43 UTC
Message-ID
<7vy7mu6ihj.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<17881.54325.475907.468492@lisa.zopyra.com>
Bill Lear <rael@zopyra.com> writes:
Show 10 quoted lines
> What is the recommended way to create tracking branches in my private
> repo if I first create the corresponding topic branch in my private
> repo and want to publish it via a public repo?
>
> Scenario:
>
> [my private repo]
> % git checkout -b topic
> [work, work, work, commit]
> % git push /public/repo/project topic:topic

So at this point the public shared repository has refs/heads/topic branch you and colleagues can work on together. So I am puzzled about this part...

> Do I have to create the topic branch in my public repo first?  This
> seems crazy,...
because you did do so and I do not think it is crazy.

Maybe you meant "do I create tracking branch for 'topic' in public?", in which case the answer is no.

Show 6 quoted lines
> I tried this:
>
> % git pull /public/repo/project topic:origin/topic
>
> But it created a topic branch named "origin/topic" instead of a tracking
> branch.

Assuming your clone was initially made from /public/repo/project, doesn't "git fetch" without _any_ parameter work?

	$ git fetch
Previous: Bill LearNext: Bill Lear
Message 2 of 4 in “Where/how to create tracking branches?”
  1. Bill LearFeb 19, 2007
  2. Junio C HamanoFeb 19, 2007
  3. Bill LearFeb 19, 2007
  4. Junio C HamanoFeb 19, 2007

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.