Skip to content

Instantly share code, notes, and snippets.

@Ajnasz
Created February 15, 2012 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ajnasz/1834590 to your computer and use it in GitHub Desktop.
Save Ajnasz/1834590 to your computer and use it in GitHub Desktop.
Git aliases to get commits for a
[alias]
list-ticket = "!f() { branch=\"${2+}${2-`git name-rev --name-only HEAD`}\"; git rev-list --oneline --reverse --grep \"$1\" $branch; }; f"
pick-ticket = "!f() { branch=\"${2+}${2-`git name-rev --name-only HEAD`}\"; git rev-list --reverse --grep \"$1\" $branch | git cherry-pick --stdin; }; f"
pick-ticket-no-commit = "!f() { branch=\"${2+}${2-`git name-rev --name-only HEAD`}\"; git rev-list --reverse --grep \"$1\" $branch | git cherry-pick -n --stdin; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment