Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 443 Bytes

File metadata and controls

14 lines (10 loc) · 443 Bytes

Problem

I need a way to show diffs between current and previous commit (not unstaged changes) using a relative index where I don't want the commit ID hard-coded.

Solution

# brew install ack
# some versions of grep might not support negative lookahead

# show diffs since last commit
# where pattern is subfolder/*.py excluding __init__.py files
git diff --stat --name-only HEAD@{1} HEAD | ack 'subfolder\/(?!__init__).*.py'