Use pre-receive hook to do clean and post for install