When I switch the branches using
git checkout <branchname>
can I fire a hook action to do some housekeeping stuff?
I added new Java sources to a branch and then switched to other branch, compiled classes from previous branch were left in the directory. These classes started interacting as classes are in the classpath and spring noticed the annotation on the classes.
I would like to fire mvn clean command to ensure these kinds of problems don't appear when I switch the branches.
Is there a way to do this?