Skip to content

Instantly share code, notes, and snippets.

@avk
Created November 30, 2015 16:40
Show Gist options
  • Save avk/36c02ddb777a6ccdadc7 to your computer and use it in GitHub Desktop.
Save avk/36c02ddb777a6ccdadc7 to your computer and use it in GitHub Desktop.
two bash helper functions for searching git commit messages and commit history
function commit_messages {
if [ -z "$1" ]
then
echo "Please pass in a string to search for in all of this repository's log messages."
else
echo "Searching commit messages for \"$1\""
git log --grep "$1" --all
fi
}
function commit_history {
if [ -z "$1" ]
then
echo "Please pass in a string to search for in all of this repository's commits."
else
echo "Searching commit history for \"$1\""
git log -S "$1" --all
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment