git - Copying some branches of a repository into a new repository -
we have huge git repository (say )that contains many branches. want create new smaller repository (say b) contain few branches of a.
what know follows
- clone branches repository local
- push these branches repository b.
don't have method copy these branches directly repository b?. or improvement above mthod?
if have direct access repo a
, can directly branch want new repo b
.
but if need clone first, concrete example exists in "clone stable , 1 other branch in git?", , uses same tip question mentioned mnagel, git remote
:
cd b git init . git remote add -f -t remote-branch1 -t remote-branch1 remote-name remote-url
note -f
which, when used git remote add
, fetch remote_name
.
Comments
Post a Comment