A git sub-command to view your git repository in the web browser
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Go to file
sgoudham 11d7470451
refactor: add info message for `--branch`
This option only works when users have
local branches that are set up to track
remotes.

The user may be confused if they are trying
to view a branch that only exists on the remote
and not locally.

This commit adds a useful info message to
inform the user that this branch is not
tracked locally and instead is defaulting
to the default remote.
1 year ago
.github ci: avoid duplicate triggers 1 year ago
src refactor: add info message for `--branch` 1 year ago
.gitignore chore: remove `.vscode` from source control 1 year ago
CONTRIBUTING.md docs: simplify wording 1 year ago
Cargo.lock chore(deps): update testcase to `3.1.0` again 1 year ago
Cargo.toml build(cargo): only package relevant files 1 year ago
LICENSE Initial commit 3 years ago
README.md docs(README): add `nix run` command 1 year ago
flake.lock refactor(nix): use rust-toolchain.toml 1 year ago
flake.nix refactor(nix): use rust-toolchain.toml 1 year ago
rust-toolchain.toml ci: remove `stable` toolchain from ci 1 year ago

README.md

git-view ( )

About

Are you also frustrated from moving your hands away from the keyboard to view your git repository on GitHub?

Me too!!!

git-view alleviates that pain by allowing you to chuck away your mouse and instead open it via the CLI!

Note:
You should always use git view -h instead of git view --help as the manpage/html files are NOT included.

Features

  • View Branches, Commits & Issues
  • Custom Remote
  • Custom Directory

Installation

Binaries are available here.

Cargo

cargo install git-view

Nix

nix run github:sgoudham/git-view

Homebrew

brew tap sgoudham/tap
brew install git-view

Usage

$ 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

Help

git-view 1.0.0
Goudham Suresh <sgoudham@gmail.com>
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

Please read the CONTRIBUTING.md before contributing!

License

MIT

Acknowledgement

The idea for this project came about from an existing project git-open