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

Where/how to create tracking branches?

From
Bill Lear <rael@zopyra.com>
Date
Feb 19, 2007, 16:45 UTC
Message-ID
<17881.54325.475907.468492@lisa.zopyra.com>

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

[somebody else:] % git clone /public/repo/project % git checkout -b topic origin/topic [work, work, work, commit] % git push /public/repo/project topic:topic

[my private repo]
% git checkout topic
% git pull /public/repo/project topic
remote: Generating pack...
remote: Done counting 5 objects.
Result has 3 objects.
remote: Deltifying 3 objects.
remote: /3) done/3) done
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking 3 objects
 100% (3/3) done
Updating 4751fcc..2d92737
Fast forward
 A |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
% git branch
  master
* topic
% git branch -r
  origin/HEAD
  origin/master

Now, I'm on my private repo, but I really want a tracking branch for doing pulls from my public repo, or peers, for this topic branch.

Do I have to create the topic branch in my public repo first? This seems crazy, as our company repo is just another "global" public repo and each developer would need to create branches there instead of on their own machine.

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.

Bill
Next: Junio C Hamano
Message 1 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.