Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.