Skip to content

Instantly share code, notes, and snippets.

@yureative
Last active January 2, 2017 04:22
Show Gist options
  • Save yureative/2a724f88149ea021a83d to your computer and use it in GitHub Desktop.
Save yureative/2a724f88149ea021a83d to your computer and use it in GitHub Desktop.
#!/bin/bash
branch=`git branch | grep '^\*' | cut -d ' ' -f 2`
merge_branch=${GITHUB_DEFAULT_BRANCH:-master}
git checkout $merge_branch && git pull && git branch -d $branch
git branch
#!/bin/bash
branch=`git branch | grep '^\*' | cut -d ' ' -f 2`
reponame=`git config --get remote.origin.url | sed -E 's/^.+:([^.]+).+$/\1/'`
merge_branch=${GITHUB_DEFAULT_BRANCH:-master}
git push origin $branch $@
echo PR: https://github.com/$reponame/compare/$merge_branch...$branch?expand=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment