When you use Github cli for fist time on locally clone forked repo, then you get some message that asked to setup base repo to execute all queries.
$ gh issue list
? Which should be the base repository (used for e.g. querying issues) for this directory? [Use arrows to move, type to filter]
<name of owner> / <name of repo>
> <your name> / <name of repo>
If you setup wrong repo here, then these is no any gh
command to change base repo. I face this issue, but not found solution easily.
The solution is:
- Open
.git/config
file - Remove line
gh-resolved = base
- Save the file and close
OR you can use this command
$ git config --unset remote.upstream.gh-resolved
That's it, now you prompted again to select repo. Select correct repo and go ahead.
For more info refer this discussion on Github: https://github.com/cli/cli/issues/1864
Top comments (2)
This is still a very useful tip. Thanks so much. I got stuck when I used
gh repo sync
and picked the wrong repo to sync from.Thank you very much! You save my life""