Skip to content

Instantly share code, notes, and snippets.

@tednaleid
Created March 10, 2017 18:26
Show Gist options
  • Save tednaleid/0543061f6023698de11a023c8db2c558 to your computer and use it in GitHub Desktop.
Save tednaleid/0543061f6023698de11a023c8db2c558 to your computer and use it in GitHub Desktop.
`git pusho` command that pushes to origin and creates a clickable link to open a PR using upstream branch as merge target
[alias]
# clickable http link to github repo
repourl=!"echo https://$(git remote get-url --push origin | sed 's/git\\@\\(.*\\)\\.git/\\1/' | sed 's/:/\\//')"
# push out a feature branch with a clickable link for creating a pull request against your upstream origin branch
pusho = !git push origin $(git branchname) && echo "create a pull request at: $(git repourl)/compare/$(git rev-parse --abbrev-ref --symbolic-full-name @{upstream} | awk -F'/' '{print $NF}')...$(git branchname)?expand=1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment