I would suggest a new orphan branch with cherry-picking afterwards.
That way you can check everything and maybe even leave the old state as a backup on your machine.
To start things off create a new branch at the point of C2
$ git checkout <Hash of C2>
$ git checkout --orphan new-master
git checkout --orphan
will create a new branch with no parents.
At this point add or remove files as you like with
git add
Add files for this new first commit
git rm --cached
Remove files for the new first commit but leave them on the hard drive
git rm
Delete files for the first commit as well as from the hard drive
Make sure that all files are present that are going to be changed by later commits, otherwise the cherry-picking might get very messy.
Now git commit
to get your new initial commit ready.
Last but not least simply reapply all the other commits by cherry-picking
the correct ranges.
$ git branch new-starting-point # for future reference
$ git cherry-pick ^C2 master
And repeat these steps for all the other branches that need a new history.
$ git checkout -b new-server new-starting-point
$ git cherry-pick ^C2 server
If you want to check for correctness you might want to do some git diff master new-master
.
To clear space delete all old branches (so that the old commits are not reachable anymore). At the following step you might lose data. Be sure you still have everything you want: A git gc
should be all you need to clear space.