The GitHub CLI (Command Line Interface), gh
, offers many useful options, including:
which opens the current repository on GitHub or at least provides its URL. However, if you try it, you'll find that it actually redirects you to the repository from which your repository was forked, UACPSC/cpsc-480-se-fall-2025-requirements-report-UserStoryReport
, or gives you the following error:
This default repository also affects other commands.
To fix this, you can run the following command in your local repository to change the default remote to your own repository:
Run this command each time you clone your repository. To avoid having to remember it, you can set up a gh alias
:
Afterward, you can simply run:
Additionally, instead of using the hardcoded UACPSC
, this approach works with any organization.