Skip to content

Instantly share code, notes, and snippets.

@curiouslychase
Last active December 21, 2015 02:09
Show Gist options
  • Save curiouslychase/6232838 to your computer and use it in GitHub Desktop.
Save curiouslychase/6232838 to your computer and use it in GitHub Desktop.
Requirements: - Must have an exports jira='http://my.jira.url' - must be on a branch that's not master
# $1 : remote name you want to diff against
function gdf () {
# get the current branch reference, cut with the delimiter /
# and grab the 3rd item in the list, copy to the pastebord, use the pbpaste
# as the diff name.
current_branch=`git symbolic-ref HEAD | cut -d"/" -f 3`;
git diff $1/master...HEAD --relative > ~/difflog/$current_branch.diff;
open "$jira/$current_branch";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment