Skip to content

Alias support #294

@kiprasmel

Description

@kiprasmel

Describe the feature or problem you’d like to solve

Git's aliases are extremely useful.
I'd be great to have alias support for github's cli aswell!

As mentioned in #251 (comment), I currently use aliases together with https://github.com/github/hub, such as:

~/.gitconfig:

# replace `sarpik` with your github username

[alias]
	prme =        pull-request --push -a sarpik  --base        master  -epo                                                  # targets upstream
	prmee =  !hub pull-request --push -a sarpik  --base sarpik:master  -epo --head sarpik:"$(git symbolic-ref --short HEAD)" # targets origin  (your repo)
	prmed =       pull-request --push -a sarpik  --base        master -depo                                                  # targets upstream
	prmeed = !hub pull-request --push -a sarpik  --base sarpik:master -depo --head sarpik:"$(git symbolic-ref --short HEAD)" # targets origin  (your repo)

Proposed solution

Have them aliases! Preferably as close to git's configuration as possible, for simplicity's sake.

Additional context

Since hub was a proxy for git, it was easy & simple to just create git's aliases (as mentioned above) for hub itself, since git could be aliased to hub.
However, it isn't clear to me right now whether gh will be available for use as a proxy for git (see also https://github.com/cli/cli#comparison-with-hub).

Another solution would be to just call gh externally from git's aliases, like so:

[alias]
	prls = !gh pr list

Metadata

Metadata

Assignees

Labels

enhancementa request to improve CLI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions