Skip to content
mnaoumov.dev
Go back

Useful git hooks

Git hooks is a nice way to do extend git capabilities.

I decided to create some of them which helps in different day-to-day situations

I have a repository http://bitbucket.org/mnaoumov/githooks/ where you can get all of them.

So far two hooks are implemented which handles the situation when you do pull from a repository having some local commits and this ends up with ugly merge commit such as

Merge branch ‘test_merge_pull’ of ssh://bitbucket.org/mnaoumov/githooks into test_merge_pull

These commits make git history non-linear and difficult to read.

My hooks handle this situation showing the dialog

merge-commit-dialog1.png

Unfortunately git does not have pre-merge hooks and that is why I had to use post-merge and then rollback the changes. If merge had conflicts the only hook is applied is after you fix the conflicts and do commit. But in this case post-merge is not called and I have to use post-commit instead.

TODO list for other Hooks

Useful git hooks – Part 2


Share this post on:

Previous Post
Remote debugging over TeamViewer
Next Post
PowerShell Cmdlets sources