Remove trailing white spaces from all files under current directory ignoring .git and .svn directories
find . -not \( -name .svn -prune -o -name .git -prune \) -type f -exec sed -i "s/[[:space:]]*$//g" "{}" \;