Git Product home page Git Product logo

deno-git-browse's Introduction

git-browse

JSR denoland deno doc Test

Open the URL of the hosting service for the repository using the system web browser. The following hosting services are currently supported:

See ./hosting_service/services and create a PR to support more hosting services.

Usage

$ browse
#=> Opens a tree page of the current working directory in the HEAD commit of the current branch

$ browse --path=README.md
#=> Opens a blob page of README.md in the HEAD commit of the current branch

$ browse --path=README.md:10
#=> Opens a blob page of README.md with line 10 in the HEAD commit of the current branch

$ browse --path=README.md:10:20
#=> Opens a blob page of README.md with lines 10 to 20 in the HEAD commit of the current branch

$ browse --path=README.md my-awesome-branch
#=> Opens a blob page of README.md in the HEAD commit of my-awesome-branch branch

$ browse --path=README.md fd28fa8
#=> Opens a blob page of README.md in the fd28fa8 commit

$ browse --home
#=> Opens the home page of the repository

$ browse --commit
#=> Opens a commit page of the current branch

$ browse --commit my-awesome-branch
#=> Opens a commit page of my-awesome-branch branch

$ browse --commit fd28fa8
#=> Opens a commit page of fd28fa8 commit

$ browse --pr
#=> Opens a pull request page that contains the HEAD commit of the current branch

$ browse --pr my-awesome-branch
#=> Opens a pull request page that contains the HEAD commit of my-awesome-branch branch

$ browse --pr fd28fa8
#=> Opens a pull request page that contains the fd28fa8 commit

Install

As a git alias

Add the followings to your .gitconfig

[alias]
  browse = "!deno run --allow-net --allow-run --allow-read --allow-env jsr:@lambdalisue/git-browse/cli"

Then use it as git browse like

$ git browse --help

As an isolated command

Use deno install command to install the command.

$ deno install --allow-net --allow-run --allow-read --allow-env -n browse jsr:@lambdalisue/git-browse/cli

Then use it as browse like

$ browse --help

License

The code follows MIT license written in LICENSE. Contributors need to agree that any modifications sent in this repository follow the license.

deno-git-browse's People

Contributors

kitagry avatar lambdalisue avatar peacock0803sz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

deno-git-browse's Issues

`git browse` does not work

Git alias browse from README and its command does not work:

$ deno run --allow-net --allow-run --allow-read https://deno.land/x/git_browse/bin/browse.ts
error: Relative import path "@cross/dir" not prefixed with / or ./ or ../
    at https://deno.land/x/[email protected]/bin/browse.ts:6:21

Deno is version 1.42.2, installed via pacman

`./bin/browse.ts` fails in slash-containing branch

Fails in branch name containing slash....

Error message

[2]: error: No such remote 'origin/fix'

Steps to reproduce

  1. Fork this repo
  2. git switch -c fix/slash-branch
  3. git commit --allow-empty
  4. git push origin
  5. ./bin/browse.ts got error

Environments

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.