読者です 読者をやめる 読者になる 読者になる

詩と創作・思索のひろば

ドキドキギュンギュンダイアリーです!!!

Released git-browse-remote 0.0.4 #git

Git Ruby

git-browse-remote provides a Git subcommand that enables you to view the repository in your web browser easily (e.g. GitHub). Japanese introduction is here.

This version supports

  • --stdout option to show the URL instead of launching web browser
  • specifying directory as an argument, relative path supported (thanks hirose31 for #8!)

Installation

% gem install git-browse-remote

Usage

Just hit

% git browse-remote

In your GitHub-cloned repository. This opens the repository's web page e.g. https://github.com/motemen/git-browse-remote.

DWIM-ish behavior

Not only to open the top page, git-browse-remote accepts arguments and shows what you want to see. (And this makes git-browse-remote different from hub browse.)

For example:

Viewing a single commit

% git browse-remote HEAD~1
# Will open https://github.com/motemen/git-browse-remote/commit/45b8acc7421e23b287ed29232a91828d2031c529

Viewing a single file

% git browse-remote README.md -L1
# Will open https://github.com/motemen/git-browse-remote/blob/master/README.md#1

# Or commit SHA1 instead of branch name
% git browse-remote --rev README.md -L1
# Will open https://github.com/motemen/git-browse-remote/blob/51d4ccc/README.md#1

Viewing a remote branch

# If you did `git remote add hirose31 https://github.com/hirose31/git-browse-remote.git` before
% git browse-remote hirose31/feature/opendir
# Will open https://github.com/hirose31/git-browse-remote/tree/feature/opendir

For more information, please visit the website.

If you find this tool useful and found any bugs, please report issues on GitHub. Thanks!