open-remote
open-remote - a simple git remote opening tool.
tested and works well for:
- github
- bitbucket
- gitea
- secure scuttlebutt (ssb)
if there are other git hosting websites that you would like to use this with, either let me know or make a pull request with the augmentation for that host.
setup
[sudo] gem install open-remote
making a git alias for 'git open' in your .gitconfig:
open-remote --alias
removing the alias, if you don't want it anymore:
open-remote --unalias
usage
git open
opens the first listed git remote. to open a specific remote, specify some of the remote or host name. for example:
git open bit
git open bucket
git open bitbucket
will all open the current repository's bitbucket remote in the browser. additionally, you can use the remote name to specify which URL to open:
git open origin
secure scuttlebutt
secure scuttlebutt repos have no web host - the repo is a message on the feed, so there is nothing to translate to https. those remotes:
ssb://%3HY71B7em4rZwMwz76yHIJZA1zo5BMBLd7Msh8LRFHI=.sha256
are handed to your system's registered ssb:// handler (patchwork,
manyverse, etc) instead. git-ssb:// remotes are normalized to ssb://
first. if nothing is registered for the scheme, your desktop will say so -
open-remote does not guess at a web gateway.
about
the original idea for this came from my friend charlie who initially provided me with a simple git alias that would do the same, but it only worked for repos that were https and was not platform independent. I was also inspired by the git-up ruby gem in how seamlessly it integrated with git. Here is the original git alias (made to work on osx), which charlie wrote (plop it in your .gitconfig, if you don't want to install a ruby gem to open most of your git remotes):
[alias]
open-remote = "!open $(git remote -v $@ | grep -o 'http\\S*' | head -1); :"
development
testing
bundle || gem install bundler && bundle
rake # run test suite
rake format # auto-fix code formatting
rake format_check # check code formatting
changelog
see CHANGELOG.md for detailed release history and changes.