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 like to have 1 GitHub project. That way, bugs can be organized by the project.
How can I set this up so that it isn’t that difficult to manage? Do I need to redo my repository layout and create new git repositories locally for each project? That would be really time involved and I might be losing the Git history.
Walter
Depending on how your repo is organized, you can use
git filter-branchto create a new repo for each project, retaining history for each individual project only.Assuming your current repo structure is like this:
You can first clone your repo (
git filter-branchwill remove files and their history, so clone your original repo first). Then, in your cloned repo, you can usegit filter-branchto create a new repo (with all the old history) at the root ofproject1:Now, your repo will look like the following:
And it will still contain the history for all files that were stored under
project1/in the old repo.Repeat that step for each project, and you will now have three independent repos, with all the history for their relevant projects.