run marco or script or tools when exit happened

is it possible to define a marco or tools or script happens when exit event occur .
suppose i want to commit and push my changes to git repository when i close phpstorm automatically

Please sign in to leave a comment.