The easiest way to avoid chaos is to give the server more disk.
This is a tough one. Removing the files requires removing them from the history, too, which can only be done with git filter-branch. This command, for example, would remove <file> from the history:
git filter-branch --index-filter 'git rm --cached --ignore-unmatch <file>' \
--prune-empty --tag-name-filter cat -- --all
The problem is this rewrites SHA1 hashes, meaning everyone on the team will need to reset to the new branch version or risk some serious headache. That's all fine and good if no one has work in progress and you all use topic branches. If you're more centralized, your team is large, or many of them keep dirty working directories while they work, there's no way to do this without a little bit of chaos and discord. You could spend quite a while getting everyone's local working correctly. That written, git filter-branch is probably the best solution. Just make sure you've got a plan, your team understands it, and you make sure they back up their local repositories in case some vital work in progress gets lost or munged.
One possible plan would be:
- Get the team to generate patches of their work in progress, something like
git diff > ~/my_wip.
- Get the team to generate patches for their committed but unshared work:
git format-patch <branch>
- Run
git filter-branch. Make sure the team knows not to pull while this is happening.
- Have the team issue
git fetch && git reset --hard origin/<branch> or have them clone the repository afresh.
- Apply their previously committed work with
git am <patch>.
- Apply their work in progress with
git apply, e.g. git apply ~/my_wip.