Skip to main content

Open repositories, directories, and files in the browser

Project description

PyPI Python Versions

Codeship Status for albertyw/git-browse Dependency Status Code Climate Test Coverage

Open repositories, directories, and files in the browser

This is a script that can be added as a gitconfig alias to easily browse repositories on Git hosting services (e.g. github). It is built to model [arcanist’s] (https://github.com/phacility/arcanist) browse command. It is specifically designed to have no dependencies so it should be easily installable and very portable.

If you’re looking to browse different github repositories, you might like hub browse.

Installation

You need to first clone this repository somewhere on your system (perhaps in your dotfiles) repository.

git clone git@github.com:albertyw/git-browse $REPOSITORY_LOCATION
git config --global \
    alias.browse \
    "!"$REPOSITORY_LOCATION"/git_browse/browse.py --path=\${GIT_PREFIX:-./}"

Usage

Usage: git browse [-h] [--path PATH] [--dry-run] [target]

If [target] is omitted, the root repository page will be opened. If [target] is a directory or file, then that object will be opened. If [target] is a commit hash, then that commit hash will be opened. If --path is available, then its value is be used to compute the relative path to the current git repository If --dry-run is set, then git-browse will only print out the target url instead of opening it in a browser

Examples

Command

Opens

git browse

https://github.com/albertyw/git-browse

git browse README.rst

https://github.com/albertyw/git-browse/blob/master/README.rst

git browse git_browse

https://github.com/albertyw/git-browse/tree/master/git_browse/

git browse v1.1.1

https://github.com/albertyw/git-browse/commit/80b219dee0aaa86b378993cbf88511126b813c5f

Development

pip install -r requirements-test.txt
coverage run setup.py test
coverage report
flake8

Publishing

sudo apt-get install pandoc
pip install twine
python setup.py sdist bdist_wheel
twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git-browse-2.3.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

git_browse-2.3.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file git-browse-2.3.2.tar.gz.

File metadata

  • Download URL: git-browse-2.3.2.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for git-browse-2.3.2.tar.gz
Algorithm Hash digest
SHA256 ef5b32dc392ebf796854a47a7d16c7c699d09db987698b2d0d601fe619e30594
MD5 91a0adff3f608bfc337f8494e87b3b55
BLAKE2b-256 8dcbe5539e8048cb2815d651d97b569668ac157f0f7156ce24c2b1345064ef92

See more details on using hashes here.

File details

Details for the file git_browse-2.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for git_browse-2.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 de5e16e47bf935dc24083386172a77fb35cd85cab6aceadef45147a213e64ce3
MD5 0e8d57f525c55206b8b49f21c8239483
BLAKE2b-256 267d7ee1bb1a00d0abac1f6fb396a0a19a7bf52ef3bdf9b1bae133bc41eaf7ec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page