2 个版本 (1 个稳定版)
1.0.0 | 2023 年 7 月 4 日 |
---|---|
0.1.0 | 2022 年 6 月 26 日 |
#2911 in 命令行工具
52KB
1K SLoC
git-view ( )
关于
你是否也因在 GitHub 上查看 git 仓库而感到手离开键盘的痛苦?
我也是!!!
git-view
通过允许您通过 CLI 打开它而不是使用鼠标来减轻这种痛苦!
注意
您应该始终使用git view -h
而不是git view --help
,因为 manpage/html 文件不包含在内。
功能
- 查看分支、提交和问题
- 自定义远程
- 自定义目录
安装
二进制文件可在 此处 获取。
Cargo
cargo install git-view
Nix
nix run github:sgoudham/git-view
Homebrew
brew tap sgoudham/tap
brew install git-view
用法
$ git view
# https://github.com/TRACKED_REMOTE_USER/REPO/tree/CURRENT_BRANCH
$ git view --remote remote
# https://github.com/PROVIDED_REMOTE_USER/REPO/tree/CURRENT_BRANCH
$ git view --remote remote --branch branch
# https://github.com/PROVIDED_REMOTE_USER/REPO/tree/PROVIDED_BRANCH
$ git view --issue
# Branch 'TICKET-123'
# https://github.com/TRACKED_REMOTE_USER/REPO/issues/123
$ git view --issue 42
# https://github.com/TRACKED_REMOTE_USER/REPO/issues/42
$ git view --commit
# https://github.com/TRACKED_REMOTE_USER/REPO/tree/CURRENT_COMMIT
$ git view --commit efa38be50ad34d
# https://github.com/TRACKED_REMOTE_USER/REPO/tree/efa38be50ad34d
$ git view --commit efa38be50ad34d --path src/lib.rs
# https://github.com/TRACKED_REMOTE_USER/REPO/tree/efa38be50ad34d/src/lib.rs
$ git view --path
# Working Directory 'src/lib.rs'
# https://github.com/TRACKED_REMOTE_USER/REPO/tree/CURRENT_BRANCH/src/lib.rs
$ git view --path CONTRIBUTING.md
# https://github.com/TRACKED_REMOTE_USER/REPO/tree/CURRENT_BRANCH/CONTRIBUTING.md
$ git view --path CONTRIBUTING.md --branch testing
# https://github.com/TRACKED_REMOTE_USER/REPO/tree/PROVIDED_BRANCH/CONTRIBUTING.md
$ git view --print
# prints https://github.com/TRACKED_REMOTE_USER/REPO/tree/CURRENT_BRANCH
帮助
git-view 1.0.0
Goudham Suresh <[email protected]>
A git sub-command to view your git repository on GitHub
USAGE:
git-view [OPTIONS]
OPTIONS:
-r, --remote <name> The remote to view on GitHub
[default: default remote]
-b, --branch <name> The branch to view on GitHub
[default: current branch]
-i, --issue <number> The GitHub issue number
[default: number from current branch]
-c, --commit <hash> The commit to view on GitHub
[default: current commit]
-p, --path <path> The directory/file to view on GitHub
[default: current working directory]
--print Print URL instead of opening on GitHub
-h, --help Print help information
-V, --version Print version information
贡献
在贡献之前,请阅读 CONTRIBUTING.md!
许可证
致谢
这个项目的想法源于现有的项目 git-open
依赖关系
~2–11MB
~143K SLoC