I have two directories:
projects. I would like to prevent myself from running
git ... unless I am specifically inside
projects. Is this possible?
It is difficult to prevent the binary from being run but for the typical situations an easy protection method exists:
The shell function could look like this:
An unusual one: if using
That way, it doesn't get in your way, but let you know of a potential problem.