If you are a sysadmin or developer that uses a lot of repos throughout the day, and you use Github, this little snippet will come in handy. No more opening a browser window and fumbling around trying to navigate to your repo. Just type gh anywhere inside your project path and a browser window will open your repo on Github.
For this to work, you’ll need to do two things:
- Copy the snippet to ~/bin/gh
- Make it executable by running: chmod +x ~/bin/gh
- Reload or restart your terminal, browse into a Github project, type gh and boom!