开发者

Import a git repo into an empty branch

Lets say a project has been developed in one repo, and the project website was developed in another.

Is there a way to import the website repo, with full history, into an empty 开发者_JAVA技巧branch of the project repo?


git remote add rweb git://whereever
git fetch rweb

And voilà, you have it in one repository. Perhaps you then also want to create a branch out of it, to make it accessible and pushable:

git branch website rweb/master
git push origin website

Starting with an empty branches and dumping the website tree instead would have the drawback of losing all the history.


I guess this would be a case for git submodules

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜