Created
September 26, 2016 19:38
-
-
Save carlossless/8179e2e16decb12c9e78956fee905929 to your computer and use it in GitHub Desktop.
A script to log the last commit message to the users shared git log
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 | |
# A script to log the last commit message to the users shared git log | |
# Useful to keep track of what you did durring a specific day | |
LOG_PATH="$HOME/gitlogs" | |
DATE=`date +'%Y-%m-%d'` | |
COMMIT=`git log --color --graph --pretty=format:'%h %s' -1 HEAD` | |
REPO_PATH=`git rev-parse --show-toplevel` | |
REPO_NAME=`basename "$REPO_PATH"` | |
mkdir -p "$LOG_PATH" | |
echo "$REPO_NAME $COMMIT" >> "$LOG_PATH"/"$DATE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment