Re: Getting new branches from remote repo.

From
Junio C Hamano <hidden>
Date
2016-08-11 20:17:26
"Alexander Litvinov" [off-list ref] writes:
I have a trouble I don't know how to solve. When I am cloning remote
repo I automatically get all it's branches stored at my repo (they are
listed at .git/remotes/origin). When someone adds new branch(es) to
remote repo git pull (git fetch) does not automatically add them to my
repo. I have a tool to list all remote branches (git ls-remote --heads
origin) but I can't find how to add interesting (or all) branches to
by repo.
After finding out $that_new_branch's name, add either

	Pull: refs/heads/$that_new_branch:refs/heads/$that_new_branch

or if you are in "separate remote" school, then perhaps

	Pull: refs/heads/$that_new_branch:refs/remotes/origin/$that_new_branch

to .git/remotes/origin and running git fetch would give you what
you want, I think.
By the way, how can I clone remote repo created by cloning another
repo using git clone --use-separate-remotes ? Even git ls-remote
--heads origin does not show all branches taken from that another
repo.
Well, the point of "separate remote" is not to pollute local
heads/ namespace with refs that merely track remote repository,
so if you say "ls-remote --heads" you would not see them.  They
are not "heads" in that repository.

You would still see them if you say "ls-remote" without --heads.
Thread (8 messages) 8 messages, 6 authors, last reply 2016-08-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help