Discover, install, and configure shell plugins with Fig Plugin Store →
💾

Browse Commit

browse-commit is an oh-my-zsh plugin that lets you open any commit in your browser from the command line.

adolfoabegg
|
15 stars
2 forks

browse-commit

browse-commit is an oh-my-zsh plugin that lets you open any commit in your browser from the command line.

Setup

oh-my-zsh

  • clone browse-commit in ~/.oh-my-zsh/custom/plugins
  • enable this plugin by adding browse-commit to the plugins list in your ~/.zshrc file
  • cd into/your/project
  • git config --add browse-commit.url https://github.com/[your-username-here]/[your-project-here]/commit

Example

$> git clone git://github.com/adolfoabegg/browse-commit.git ~/.oh-my-zsh/custom/plugins/browse-commit
$> vim ~/.zshrc
   // add browse-commit to the list of enabled plugins
   plugins=(git osx browse-commit)
$> cd ~/code/browse-commit
$> git config --add browse-commit.url https://github.com/adolfoabegg/browse-commit/commit
$> brc 9893058ccd2c5384748a10e491181a0d9955b80d

That will open https://github.com/adolfoabegg/browse-commit/commit/9893058ccd2c5384748a10e491181a0d9955b80d in my default browser.

Antigen

If you're using Antigen, just add antigen bundle adolfoabegg/browse-commit to your .zshrc along with your other plugins.

Zgen

If you're using zgen, add zgen load adolfoabegg/browse-commit to your .zshrc along with your other plugins.

Usage

  • brc opens the last commit in the default browser
  • brc bc7b10a opens a specific commit in the defaul browser
  • cpc copies the url of the last commit to the clipboard
  • cpc bc7b10a copies the url of a specific commit to the clipboard

Compatibility

browse-commit uses open, so it currently only works on OS X.

Author

Adolfo Abegg