Skip to content

Instantly share code, notes, and snippets.

@ianfoo
Created September 21, 2019 00:24
Show Gist options
  • Save ianfoo/69afa3046246660bceb38cb71457a648 to your computer and use it in GitHub Desktop.
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
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