install precommit-hook, cleanup codes