Skip to content

Instantly share code, notes, and snippets.

@colinux
Created April 23, 2012 10:39
Show Gist options
  • Save colinux/2470153 to your computer and use it in GitHub Desktop.
Save colinux/2470153 to your computer and use it in GitHub Desktop.
git search alias: search for a pattern/keyword in commits history
# ~/.gitconfig:
[alias]
search = "!f () { git grep -E -n "$1" $(git log --pretty=format:%h -E --pickaxe-regex -G"$1" "$2") -- "./$2"; }; f"
# Usage:
git search "keyword|regex" <tree>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment