Skip to main content

Open repositories, directories, and files in the browser

Project description

Git Browse
==========

|PyPI| |PyPI|

|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 <https://github.com/phacility/arcanist/blob/master/src/workflow/ArcanistBrowseWorkflow.php>`__
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 <https://github.com/github/hub/blob/master/commands/browse.go>`__.

Installation
------------

You need to first clone this repository somewhere on your system
(perhaps in your `dotfiles <https://github.com/albertyw/dotfiles>`__)
repository.

.. code:: bash

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 [object]

If ``[object]`` is omitted, the root repository page will be opened. If
``[object]`` is a directory or file, then that object will be opened. If
``[object]`` is a commit hash, then that commit hash will be opened.

Examples
~~~~~~~~

+----------------------------+----------+
| Command | Opens |
+============================+==========+
| ``git browse`` | https:// |
| | github.c |
| | om/alber |
| | tyw/git- |
| | browse |
+----------------------------+----------+
| ``git browse README.md`` | https:// |
| | github.c |
| | om/alber |
| | tyw/git- |
| | browse/b |
| | lob/mast |
| | er/READM |
| | E.md |
+----------------------------+----------+
| ``git browse git_browse`` | https:// |
| | github.c |
| | om/alber |
| | tyw/git- |
| | browse/t |
| | ree/mast |
| | er/git\_ |
| | browse/ |
+----------------------------+----------+
| ``git browse v1.1.1`` | https:// |
| | github.c |
| | om/alber |
| | tyw/git- |
| | browse/c |
| | ommit/80 |
| | b219dee0 |
| | aaa86b37 |
| | 8993cbf8 |
| | 8511126b |
| | 813c5f |
+----------------------------+----------+

Development
-----------

.. code:: bash

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

Publishing
----------

.. code:: bash

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

.. |PyPI| image:: https://img.shields.io/pypi/v/git-browse.svg
:target: https://github.com/albertyw/git-browse
.. |PyPI| image:: https://img.shields.io/pypi/pyversions/git-browse.svg
:target:
.. |Codeship Status for albertyw/git-browse| image:: https://codeship.com/projects/fbd67810-b952-0134-2c2e-166255a25182/status?branch=master
:target: https://codeship.com/projects/194945
.. |Dependency Status| image:: https://gemnasium.com/badges/github.com/albertyw/git-browse.svg
:target: https://gemnasium.com/github.com/albertyw/git-browse
.. |Code Climate| image:: https://codeclimate.com/github/albertyw/git-browse/badges/gpa.svg
:target: https://codeclimate.com/github/albertyw/git-browse
.. |Test Coverage| image:: https://codeclimate.com/github/albertyw/git-browse/badges/coverage.svg
:target: https://codeclimate.com/github/albertyw/git-browse/coverage


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.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

git_browse-2.3.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for git-browse-2.3.0.tar.gz
Algorithm Hash digest
SHA256 b195bd9efe86a824b518148cfb27a244ebbf788d9d625fd78c017722b9e8295c
MD5 984fedad179da60a1cc1db24f7ae6a21
BLAKE2b-256 18803c0760d7707df5c91ccfd9586e25eeb9e9d0955dc4d3deab66553e1991da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for git_browse-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 111397ee3396f83c0029b0c3af781b884aae557db4e7f126c6fc1f4ba60a1dcf
MD5 5e897a2c4d19bdbc9d1781f6a48e7a7d
BLAKE2b-256 2ddec6e8c098c2ba4cb8466bbbf6202718fb7ed17976d092f7ee7eaad0ed4606

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