Created
September 21, 2019 00:24
-
-
Save ianfoo/69afa3046246660bceb38cb71457a648 to your computer and use it in GitHub Desktop.
Shell function to show git diff only for changes made to a branch
This file contains hidden or 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
git-diff-branch-only () { | |
local branch=${1:-$(git branch --show-current)} | |
local base=${2:-master} | |
git diff $(git merge-base $branch $base) $branch | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment