pre-commit Check git merge conflict by default. Install npm install githook-pre-commit Use package.json // add pre-commit { "scripts": { "echo": "echo \'pre-commit\' cool!" }, // command in scripts "pre-commit": ["echo"] } Go version pre-commit-go (https://github.com/BarryYan/pre-commit-go) Demo