开发者

How to join two different git repositories into one with two branches?

I want to join two different git开发者_高级运维 repositories into one repository with two branches. Is it possible? How?


Create a new repository, then add both of these repositories as remotes:

git remote add origin1 ...
git remote add origin2 ...

Fetch from both:

git fetch origin1
git fetch origin2

Create a local branch to track a branch of each remote (assuming the master):

git branch branch1 origin1/master
git branch branch2 origin2/master
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜