Open web browser to view remote Git repositories
Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 75 commits behind motemen:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
.gitignore
README.md
git-browse-remote.gemspec

README.md

git-browse-remote

git-browse-remote helps viewing remote repositories e.g. GitHub in your browser.

USAGE

git browse-remote [-r|--remote <remote>] [--top|--rev|--ref] [<commit> | <remote>]

git-browse-remote opens your web browser by git web--browse to show current repository in browser.

git-browse-remote depends on what commit/ref HEAD points (or you supplied by an argument), such as:

As a special case, if commit is invalid and an valid remote name, that remore repository's page is opened.

HOW TO SET UP

git browse-remote stores url mapping in ~/.gitconfig. To initialize this, execute with --init option.

% git browse-remote --init
Writing config for github.com...
Mappings generated:
browse-remote.github.com.top https://{host}/{path}
browse-remote.github.com.ref https://{host}/{path}/tree/{short_ref}
browse-remote.github.com.rev https://{host}/{path}/commit/{commit}

Execute git config browse-remote.<host>.{top|ref|rev} <url template> to register other hosts mappings.

Especially, if you have a GitHub Enterprise repository, run

% git browse-remote --init <ghe host>=github

to easyly setup url mappings. --init <host>=gitweb is also available.

VARIABLES AVAILABLE IN URL TEMPLATE

  • host (eg. "github.com")
  • path (eg. "motemen/git-browse-remote")
    • Sliceable, subscribable like an Array
  • ref (eg. "refs/heads/master")
  • short_ref (eg. "master")
  • commit (eg. "04f7c64ba9d524cf311a673ddce5722b2441e2ea")