You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include the gh co alias in the gh pr documentation #4789
Describe the feature or problem you’d like to solve
While reading the comments on #1303 I discovered that a default alias of gh co is included which maps to gh pr checkout, a command that I use regularly. This alias is not included in the documentation for gh pr or gh pr checkout and I wasn't aware of the alias feature.
Proposed solution
When a user is reading the documentation for gh pr or gh pr checkout, the gh co alias should be mentioned too. There are a few places it could be added:
Hi, thanks for suggesting this, but I don't think we should hardcode co into the documentation because co isn't guaranteed to be present.
When you first set up GitHub CLI on a machine, the co alias is added as the only default alias. You can inspect it with gh alias list, you can override it to something else, or you can remove it. Furthermore, if you're authenticating via environment variables like GITHUB_TOKEN (for example in an isolated CI job), the default gh config file might not even get generated, and thus the default alias will not be present.
Because of all this, it would be incorrect to document the presence of co as if it was fact. It's there both as an example and added for convenience, but it should ideally be discovered by users through interacting with their gh setup at runtime and not via the static documentation.
Activity
mislav commentedon Nov 23, 2021
Hi, thanks for suggesting this, but I don't think we should hardcode
cointo the documentation becausecoisn't guaranteed to be present.When you first set up GitHub CLI on a machine, the
coalias is added as the only default alias. You can inspect it withgh alias list, you can override it to something else, or you can remove it. Furthermore, if you're authenticating via environment variables like GITHUB_TOKEN (for example in an isolated CI job), the default gh config file might not even get generated, and thus the default alias will not be present.Because of all this, it would be incorrect to document the presence of
coas if it was fact. It's there both as an example and added for convenience, but it should ideally be discovered by users through interacting with theirghsetup at runtime and not via the static documentation.