Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spenserblack/gh-permalink
Create a permalink from the CLI
https://github.com/spenserblack/gh-permalink
gh-extension
Last synced: 24 days ago
JSON representation
Create a permalink from the CLI
- Host: GitHub
- URL: https://github.com/spenserblack/gh-permalink
- Owner: spenserblack
- License: mit
- Created: 2023-06-26T14:21:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-29T19:04:00.000Z (6 months ago)
- Last Synced: 2024-06-21T18:00:48.677Z (5 months ago)
- Topics: gh-extension
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gh permalink
[![CI](https://github.com/spenserblack/gh-permalink/actions/workflows/ci.yml/badge.svg)](https://github.com/spenserblack/gh-permalink/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/spenserblack/gh-permalink/branch/main/graph/badge.svg?token=HOyIAY5JyM)](https://codecov.io/gh/spenserblack/gh-permalink)Create a permalink from the CLI
## Installation
```shell
gh extension install spenserblack/gh-permalink
```## Usage
```shell
# Permalink a file
gh permalink my-file# Permalink a line
gh permalink my-file 1# Permalink a range of lines
gh permalink my-file 1-5
```### Advanced
#### Permalinking Commits
This extension creates a permalink from the current HEAD commit. If you need to create a permalink
to a different commit, checkout that commit first.```shell
git checkout v0.1.0
gh permalink my-file
# now you have a permalink to my-file at the commit tagged by v0.1.0
git checkout - # go back to where you were previously checked out
```## Caveats
While this can create a permalink for any commit, that permalink will
return a 404 error if the commit is not pushed. This extension doesn't
handle pushing commits for you, so you'll need to do that yourself if
you want to create a permalink to a file that may be ahead of the remote.