Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 853 Bytes

README.md

File metadata and controls

44 lines (32 loc) · 853 Bytes

gitbrose

command line utility that is able to translate any local git file to the web page of its remote.

Supported types of remotes are:

  • Github
  • Gitlab
  • AWS CodeCommit

Installation

wget https://github.com/mhristof/gitbrowse/releases/latest/download/gitbrowse.$(uname) -O ~/bin/gitbrowse
chmod +x ~/bin/gitbrowse

Usage

Github with ssh remote

$ git config --get remote.origin.url
[email protected]:mhristof/gitbrowse.git
$ gitbrowse Makefile
https://github.com/mhristof/gitbrowse/blob/master/Makefile

Vim

You can use gitbrowse from you Vim with this snippet

function GitBrowse()
    let line=line(".") + 1
    exec "silent !open $(gitbrowse " . expand('%') . " --line " . line . ")"
    exec ":redraw!"
endfunction

and if you want to abberviate it

cabbrev bb :call GitBrowse()<cr>