Last active
May 13, 2016 20:20
-
-
Save deadlocked247/fd1188b6e275926b87fbf8993ae53d0e to your computer and use it in GitHub Desktop.
Automatically add branch names before commit messages via hooks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find vendor -name ".git*" -type d | while read i | |
do | |
if [ -d "$i" ]; then | |
DIR=`dirname $i` | |
rm -fR $i | |
git rm -r --cached $DIR > /dev/null 2>&1 | |
git add $DIR > /dev/null 2>&1 | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BRANCH=`git branch | grep '^\*' | cut -b3-` | |
FILE=`cat "$1"` | |
echo "$BRANCH $FILE" > "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment