Skip to content

Instantly share code, notes, and snippets.

Avatar

Artem Kuznetsov artemsky

View GitHub Profile
@artemsky
artemsky / post-checkout
Last active Apr 15, 2018
Post merge git hook to check Laravel 5+ typical resources were updated
View post-checkout
#!/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
@artemsky
artemsky / prepare-commit-msg
Last active Sep 27, 2017
pre-commit hook: prepend JIRA Task Name
View prepare-commit-msg
#!/bin/sh
# Automatically adds branch name to the end of every commit message.
NAME=$(git branch | grep '*' | sed 's/* //')
echo "$NAME" "$(cat "$1")" > "$1"