Skip to content

Instantly share code, notes, and snippets.

@subelsky
Last active December 16, 2015 22:39
Show Gist options
  • Save subelsky/5509070 to your computer and use it in GitHub Desktop.
Save subelsky/5509070 to your computer and use it in GitHub Desktop.
how to add mercurial-style "in" and "out" commands to git, thanks @bkemper for showing me these
# I learned this from @bkemper, very useful to show what's in a commit about to be pushed to the remote repo
# and what's in the commits that are about to be pulled from the remote repo
[alias]
in = "!f() { [[ -z \"$1\" ]] && B='master' || B=\"$1\"; git log $B..origin/$B; }; f"
out = "!f() { [[ -z \"$1\" ]] && B='master' || B=\"$1\"; git log origin/$B..$B; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment