We ended up writint two scripts for fixing file and directory names in all commits.
For files:
#!/bin/bash
echo "$1 --> $2"
cmd="if [ -f '$1' ]
then
mv '$1' '$2'
fi"
git filter-branch --tree-filter "$cmd" --force -- --all
For directories:
#!/bin/bash
echo "$1 --> $2"
cmd="if [ -d '$1' ]
then
mv '$1' '$2'
fi"
git filter-branch --tree-filter "$cmd" --force -- --all
Depending on the OS and terminal you cannot enter some characters. Most of the time you can just type a ?
in the first pattern. The scripts assume that a file/directory is visible in the currently checkout out branch.