I want to use a bash function in a git alias. So I added this to my .bashrc
:
fn() {
echo "Hello, world!"
}
export -f fn
and to my .gitconfig
:
[alias]
fn = !fn
But then git fn
produces an error:
fatal: cannot run fn: No such file or directory
fatal: While expanding alias 'fn': 'fn': No such file or directory
Is this a correct way to use a bash function in a git alias definition?