Skip to content

Instantly share code, notes, and snippets.

View 0x1mason's full-sized avatar

Eric Millin 0x1mason

  • IBM
  • Durm, Cackalack del Norte
View GitHub Profile
@0x1mason
0x1mason / Instructions.md
Created January 16, 2016 22:55 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@0x1mason
0x1mason / pre-push.sh
Created January 18, 2016 15:18 — forked from pixelhandler/pre-push.sh
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`