Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 797 Bytes

README_src.adoc

File metadata and controls

34 lines (25 loc) · 797 Bytes

gho

A simple multi-platform cli utility written in Rust that opens your browser in your project’s repo on gitlab or github.

While a bash script like the following could work, that will not work on Windows:

gho ()
{
    ( set -e;
    git remote -v | grep push;
    remote=${1:-origin};
    echo "Using remote $remote";
    URL=$(git config remote.$remote.url | sed "s/git@\(.*\):\(.*\).git/https:\/\/\1\/\2/");
    echo "Opening $URL...";
    open $URL )
}

gho on the other hand, should work fine (testers and feedback are welcome).

The url is fetched on your remotes.

Install

cargo install --locked --git https://github.com/chevdor/gho

Usage

  • gho to simply open the first remote

  • gho upstream to open your upstream remote

link:doc/usage.adoc[role=include]