开发者

Import a git repo into an empty branch

开发者 https://www.devze.com 2023-01-28 14:42 出处:网络
Lets say a project has been developed in one repo, and the project website was developed in another.

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

精彩评论

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