Git multiple sub projects from sub folders?

后端 未结 2 1973
没有蜡笔的小新
没有蜡笔的小新 2021-02-13 21:07

I have multiple projects that I\'d like to put up onto GitHub.com. All of these projects are in my local Git repository. I have just one repository, but for each project, I\'d

2条回答
  •  后悔当初
    2021-02-13 21:45

    If I'm understanding the question, you've got one large repo that contains a number of projects. You would like to break each of those projects out into individual repos without losing history. Bottom line is yes, you have to redo your repository layout and create new git repositories for each project. You don't need to lose history, though.

    1. Make a copy of your current repo, one copy for each sub project.
    2. In each of the new repos, delete all other projects except for the one associated with that repo.

    You'll still have all the history prior to breaking the original repo up, but now each project is it's own repository.

    If you don't mind losing your history, making each project into it's own git repo is as simple as running git init in the project directory. This will create a new repo for just that project.

提交回复
热议问题