Skip to content

Instantly share code, notes, and snippets.

@almozavr
Created August 19, 2013 11:36
Show Gist options
  • Save almozavr/6268185 to your computer and use it in GitHub Desktop.
Save almozavr/6268185 to your computer and use it in GitHub Desktop.
Git code review aliases
[alias]
log-branch-only = "!f() { arg1=$1; if [[ $# -lt 2 ]] || [[ $2 == -* ]] ; then arg2=$arg1; arg1='HEAD'; arg3=${*:2}; else arg2=$2; arg3=${*:3}; fi; hash=`git merge-base $arg1 $arg2`; git log $hash..$arg2 $arg3; }; f"
[alias]
diff-branch-only = "!f() { arg1=$1; if [[ $# -lt 2 ]] || [[ $2 == -* ]] ; then arg2=$arg1; arg1='HEAD'; arg3=${*:2}; else arg2=$2; arg3=${*:3}; fi; hash=`git merge-base $arg1 $arg2`; git diff $hash..$arg2 $arg3; }; f"
@almozavr
Copy link
Author

git log branch1..branch2
git diff branch1...branch2

git, U R supercool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment