Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active August 12, 2018 09:02
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 YumaInaura/a302e564eb4ceb2cfdfcd0bc077ecb5c to your computer and use it in GitHub Desktop.
Save YumaInaura/a302e564eb4ceb2cfdfcd0bc077ecb5c to your computer and use it in GitHub Desktop.
Mac OS —Open in web browser Github remote repository from console

Mac OS —Open in web browser Github remote repository from console

Extract https url from git remote command and execute open command.

$ open $(git remote --verbose | head -n 1 | awk '{ print $2 }')

You need

  • open command available
  • git remote --verbose has https protocol URL like below example.
origin	https://github.com/YumaInaura/gist (fetch)
origin	https://github.com/YumaInaura/gist (push)

Or take easier way

Create simple text file.

echo 'https://github.com/YumaInaura/gist' >> .github.url
open $(cat .github.url)

If you commited this file to git, you can open Github webpage anytime from console.

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