Skip to content

mhristof/gitbrowse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>