This question already has an answer here:
Is it available to set script to run in a particular directory, when you
cd into it?
For example if
/foo is a directory with
git project, is it possible, when
cd /foo automatically run
git status or some
Please don't link answer to strictly to
git, imagine that could be any other command/script.