Adding git subtree from a branch

情到浓时终转凉″ 提交于 2019-11-30 08:39:21

This seems to work

$ git remote add cow https://github.com/geoffryan/cow.git
$ git fetch cow
$ git subtree add -P cow cow/stable
Added dir 'cow'

I don't understand how to use directly the command with the repository part.

I encounter a similar problem. However, gipi's solution doesn't work for me. Oddly, when I add master branch everythins is fine, but when I want to add other branches, it returns

fatal: Couldn't find remote ref xxx/yyy
Unexpected end of command stream

So I tried another way:

mkdir tmp
cd tmp
git init
git clone url_for_xxx.git yyy

And subtree add from that temp rep's master branch:

git subtree add -P yyy /path/to/tmp/ master 
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!