Skip to content

Instantly share code, notes, and snippets.

@sgsfak
Last active September 18, 2017 07:59
Show Gist options
  • Save sgsfak/98a5ca34bffe41958f88 to your computer and use it in GitHub Desktop.
Save sgsfak/98a5ca34bffe41958f88 to your computer and use it in GitHub Desktop.
Adding a `git hub` alias
git config --global alias.hub '!open $(git config --get remote.origin.url | sed -e "s|git@github\.com:|https://github.com/|" -e "s|git@bitbucket\.org:|https://bitbucket.org/|" -e "s|\.git$||")'
@sgsfak
Copy link
Author

sgsfak commented Jul 9, 2014

Based on http://bitstream.io/adding-a-git-hub-alias.html

  • added handling of bitbucket
  • use sed instead of perl

@mfcovington
Copy link

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment