- https://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html
- http://stackoverflow.com/questions/4042816/how-can-i-rewrite-history-so-that-all-files-except-the-ones-i-already-moved-ar
- http://stackoverflow.com/questions/2797191/how-to-split-a-git-repository-while-preserving-subdirectories/18261585#18261585
- http://unix.stackexchange.com/questions/37313/how-do-i-grep-for-multiple-patterns
- https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html
git filter-branch --prune-empty --tree-filter '
if [[ ! -e httpdocs ]]; then
mkdir -p httpdocs
git ls-tree --name-only $GIT_COMMIT | xargs -I files mv files httpdocs
fi'
# this doesn't work because of the single quotes in single quotes
git filter-branch --prune-empty --tree-filter '
if [[ ! -e httpdocs ]]; then
mkdir -p httpdocs
git ls-tree --name-only $GIT_COMMIT | grep -v ^'.gitignore\|.gitattributes'$ | xargs -I files mv files httpdocs
fi'