0
![Stack Overflow](http://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png)
This can be done with pre-commit hook . To create the hook run
$ touch .git/hooks/pre-commit
$ chmod a+x .git/hooks/pre-commit
Add the following code
#!/bin/sh
path_with_pattern=$(git diff --cached --find-copies --find-renames --name-only --diff-filter=ACR | grep "\.bak-mo$")
if [[ -n $p...