如何将多个项目添加到单个 git 存储库?

如何将多个项目添加到单个 git 存储库?

我想将两个现有项目添加到单个 git 存储库中。我已经将一个项目添加到存储库中,现在我想添加第二个项目而不影响第一个项目

答案1

有一个通过--orphan分支的选项。即手册:

--orphan
    Create a new orphan branch, named <new_branch>, started from
    <start_point> and switch to it. The first commit made on this new
    branch will have no parents and it will be the root of a new history
    totally disconnected from all the other branches and commits.

这里也解释得很好https://stackoverflow.com/questions/14679614/whats-the-best-practice-for-putting-multiple-projects-in-a-git-repository

相关内容