if-then-else inside Bash Alias
I would use a function for that, like so:
gitmv()
{
# If in a git repo - call git mv. otherwise- call mv
if [ x`git rev-parse --show-toplevel 2> /dev/null` = x ];
then
mv "$@"
else
git mv "$@"
fi
}
Edit:
alias mv=gitmv