Skip to content

Instantly share code, notes, and snippets.

View kujiy's full-sized avatar

Kujiy kujiy

View GitHub Profile
@kujiy
kujiy / git-hook-add-branch-name-to-commit-msg
Created September 15, 2015 10:15
Git hook / A commit-msg for add branch name to commit message
#!/bin/sh
#ブランチ名を取得
Branch="$(git rev-parse --abbrev-ref HEAD)"
#コミットメッセージの最初にブランチ名を追加
mv $1 $1.tmpbycommit-msg
echo -n "[$Branch] " > $1
cat $1.tmpbycommit-msg >> $1
@kujiy
kujiy / php-cs-fixer-and-esformatter-pre-commit.php
Last active September 15, 2015 10:12 — forked from mardix/php-cs-fixer-pre-commit.php
A pre-commit hook to make PHP code PSR-2 compliant, check for syntax error and make Javascript code beautify with Esformatter
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
* original -> https://gist.github.com/mardix/3623562
*/
/**
* collect all files which have been added, copied or
* modified and store them in an array called output