Skip to content

Alias support #294

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

Activity

  1. vilmibm commented on Feb 3, 2020

    @vilmibm
    Contributor

    We've discussed this exact feature and there is desire to do it but looks like we never captured it in an issue, so thanks for opening! We'll use this for prioritizing and discussion.

  2. jongio commented on Feb 13, 2020

    @jongio

    Aliases as git would be helpful as well, like we do with hub https://github.com/github/hub#aliasing

  3. self-assigned this
    on May 11, 2020
  4. vilmibm commented on May 15, 2020

    @vilmibm
    Contributor

    This issue is great and was perfect for getting this discussion going! Thank you!

    I'm going to close it in favor of #936 and #939 where we're tracking sub issues and such.

  5. added a commit that references this issue on Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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