Skip to content

Instantly share code, notes, and snippets.

View artemsky's full-sized avatar

Artem Kuznetsov artemsky

View GitHub Profile
@artemsky
artemsky / prepare-commit-msg
Last active September 27, 2017 10:51
pre-commit hook: prepend JIRA Task Name
#!/bin/sh
# Automatically adds branch name to the end of every commit message.
NAME=$(git branch | grep '*' | sed 's/* //')
echo "$NAME" "$(cat "$1")" > "$1"
@artemsky
artemsky / post-checkout
Last active September 2, 2022 13:36
Post merge git hook to check Laravel 5+ typical resources were updated
#!/bin/bash
# Looks for changes and automates running bundle and other tasks.
# Does not run if your local branch is behind the remote.
# https://gist.github.com/stefansundin/82051ad2c8565999b914
# post-checkout hook - looks for changes,
# when you change branches, and if found, reinstalls the given packages every
# Exit early if this was only a file checkout, not a branch change ($3 == 1)
[[ $3 == 0 ]] && exit 0