Codebrahma

Work

Open github network graph from command line

Github's network graph is one most elegant tools to track your project's progress. Open the network graph of you current project with this shell script.

Just type network.

function network(){
    url=$(git remote -v | grep origin | awk 'FNR == 2{print $2}')
    sub_path=$(echo ${url##*github.com})
    project_name=$(echo ${sub_path:1} | rev | cut -c 5- | rev)
    project_url=$(echo "https://github.com/${project_name}/network")
    cowsay "I'm taking you to $(echo ${project_url})"
    python -mwebbrowser $(echo ${project_url})
}

network

With a little more customization.

function open_url(){
  cowsay "I'm taking you to ${1}"
  python -mwebbrowser $1
}

function gh(){
  url=$(git remote -v | grep origin | awk 'FNR == 2{print $2}')
  sub_path=$(echo ${url##*github.com})
  project_name=$(echo ${sub_path:1} | rev | cut -c 5- | rev)
  open_url "https://github.com/${project_name}/${1}"
}
gh # Open repo
gh network # Open network graph
gh pulse # Open repo pulse
gh pulls # Open pull requests
gh branches # Open branch list
gh wiki # Open wiki
Written by
Nithin Krishna
Published at
Dec 11, 2014
Posted in
Tutorial
Tags
If you want to get more posts like this, join our newsletter

Join our NEW newsletter to learn about the latest trends in the fast changing front end atmosphere

Mail hello@codebrahma.com

Phone +1 484 506 0634

Codebrahma is an independent company. Mentioned brands and companies are trademarked brands.
© 2024 codebrahma.com. All rights reserved.