Where/how to create tracking branches?

From: Bill Lear <hidden>
Date: 2016-06-15 22:42:55

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help