Skip to content

Instantly share code, notes, and snippets.

@wm
Created February 10, 2012 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wm/1787204 to your computer and use it in GitHub Desktop.
Save wm/1787204 to your computer and use it in GitHub Desktop.
Pull request from the command line
gh_info=`gh info`
repo_user=`echo ${gh_info}|grep 'You are'|sed 's/You are //g'`
repo_name=`echo ${gh_info}|grep '== Info for'|sed 's/== Info for //g'`
branch_name=`git branch|grep '\*'|sed 's/\* //g'`
pull_url="https://github.com/${repo_user}/${repo_name}/pull/new/${branch_name}"
git fetch origin && git rebase origin/master && open ${pull_url}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment