The restructure.sh script is intended for use in the Eclipse openMDM Working Group to merge multiple Git repositories into one. See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=561698
Change the variables inside of restructure.sh if the current values don't fit your needs
The script will create a new sub directory (variable SUBDIR) on do all the work inside that directory.
The script creates two local Git repositories, a bare one (will be used as remote) and a normal one (will be used as working copy).
After that, the script will add all defined repositories (variable REPOS) as new remotes to the working copy. For each added remote the script will detect the exising branches and create temporary mirror branches in the new working copy.
Then every project will be merged into the working copy (with flag --allow-unrelated-histories) and moved into an own project directory. This step will be repeated for every branch detected.
If a branch does not exits in a project, the master branch will be used to create that project directory on that branch.
Tags must be “recreated” by hand.
And the end of the script, all Tags found in the Git repositories will be listed with the corresponding commit hashes.
To create the correct state of a previous Tag take this steps:
At the end you can create a new Tag on the current branch (e.g. tag-work/5.1.0M8) and switch back to the init/empty branch (maybe you have to use git reset --hard to get the clean branch back) and repeat the steps for another Tag