Skip to content

Commit 4fea02d

Browse files
authored
Merge pull request #3 from lambdalisue/doc
📚 Update README
2 parents 0f4f40b + 626b526 commit 4fea02d

File tree

1 file changed

+76
-1
lines changed

1 file changed

+76
-1
lines changed

README.md

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,82 @@
44
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/git_browse/mod.ts)
55
[![Test](https://github.com/lambdalisue/deno-git-browse/workflows/Test/badge.svg)](https://github.com/lambdalisue/deno-git-browse/actions?query=workflow%3ATest)
66

7-
Open a system default browser with URLs of the current git repository.
7+
Open the URL of the hosting service for the repository using the system web
8+
browser.
9+
10+
## Usage
11+
12+
```console
13+
$ browse
14+
#=> Opens a tree page of the current working directory in the HEAD commit of the current branch
15+
16+
$ browse --path=README.md
17+
#=> Opens a blob page of README.md in the HEAD commit of the current branch
18+
19+
$ browse --path=README.md:10
20+
#=> Opens a blob page of README.md with line 10 in the HEAD commit of the current branch
21+
22+
$ browse --path=README.md:10:20
23+
#=> Opens a blob page of README.md with lines 10 to 20 in the HEAD commit of the current branch
24+
25+
$ browse --path=README.md my-awesome-branch
26+
#=> Opens a blob page of README.md in the HEAD commit of my-awesome-branch branch
27+
28+
$ browse --path=README.md fd28fa8
29+
#=> Opens a blob page of README.md in the fd28fa8 commit
30+
31+
$ browse --home
32+
#=> Opens the home page of the repository
33+
34+
$ browse --commit
35+
#=> Opens a commit page of the current branch
36+
37+
$ browse --commit my-awesome-branch
38+
#=> Opens a commit page of my-awesome-branch branch
39+
40+
$ browse --commit fd28fa8
41+
#=> Opens a commit page of fd28fa8 commit
42+
43+
$ browse --pr
44+
#=> Opens a pull request page that contains the HEAD commit of the current branch
45+
46+
$ browse --pr my-awesome-branch
47+
#=> Opens a pull request page that contains the HEAD commit of my-awesome-branch branch
48+
49+
$ browse --pr fd28fa8
50+
#=> Opens a pull request page that contains the fd28fa8 commit
51+
```
52+
53+
## Install
54+
55+
### As a git alias
56+
57+
Add the followings to your `.gitconfig`
58+
59+
```gitconfig
60+
[alias]
61+
browse = "!deno run --allow-net --allow-run --allow-read https://deno.land/x/git_browse/bin/browse.ts"
62+
```
63+
64+
Then use it as `git browse` like
65+
66+
```console
67+
$ git browse --help
68+
```
69+
70+
### As an isolated command
71+
72+
Use `deno install` command to install the command.
73+
74+
```console
75+
$ deno install --allow-net --allow-run --allow-read https://deno.land/x/git_browse/bin/browse.ts
76+
```
77+
78+
Then use it as `browse` like
79+
80+
```console
81+
$ browse --help
82+
```
883

984
## License
1085

0 commit comments

Comments
 (0)