Repository navigation
Description
Thanks for addressing #2090! I think the solution is great in terms of behavior, but perhaps the nomenclature could be better. In particular, as @mislav said here, referring to a "default repository" (which is implied by the command gh repo set-default is ambiguous. It would be clearer if the subcommand was e.g. git repo set-default-remote.
I also don't think the reference to "this directory" is an intuitive nomenclature. I tend to think of the directory containing a git repository as "the local repository", not as a generic directory. So I'd also suggest changing the phrasing in:
cli/pkg/cmd/repo/setdefault/setdefault.go
Line 63 in 6618baa
| Short: "Configure default repository for this directory", |
cli/pkg/cmd/repo/setdefault/setdefault.go
Line 238 in 6618baa
| fmt.Fprintf(opts.IO.Out, "%s Set %s as the default repository for the current directory\n", cs.SuccessIcon(), ghrepo.FullName(selectedRepo)) |
Line 95 in 6618baa
| "%s No default remote repository has been set for this directory.\n", |
...to say e.g. "default remote for this repository".
Originally posted by @waldyrious in #6777 (comment)
Activity
waldyrious commentedon Jan 4, 2023
For the record, I commented in #6777 instead of in an existing or new issue because that is what @mislav suggested here. I do feel it is a bit awkward to use release discussions to have discussions about specific topics (other than, say, meta discussion about the release itself). Thanks for opening a dedicated thread for this discussion!
samcoe commentedon Jan 4, 2023
@waldyrious Yup, I purposefully turned your discussion comment into a new issue as I felt it was warranted and wanted to discuss it internally with the team. We use the "discuss" label to indicate that, but labels are not available in discussions.
mislav commentedon Jan 10, 2023
Thanks for the feedback!
We discussed this a bit and we're in agreement that changing the language in the documentation, error messages, and
gh repo set-defaultcommand output to say “default (git) remote” instead of “default repository” is a good idea in order to reduce ambiguity. However, we wouldn't rename the command right now because it just shipped and because we don't think a longer, more verbose name will necessarily translate into better user experience.waldyrious commentedon Jan 10, 2023
Fair enough. Changing the messaging and documentation is already a good improvement. Would you be open to change the command name some versions down the road?
mislav commentedon Jan 10, 2023
We're open to make absolutely any change to gh down the line provided there are strong enough reasons to do so. For now, we want to first see how
gh repo set-defaultpans out, and we don't have evidence that a rename would be a significant improvement.waldyrious commentedon Jan 24, 2023
By the way, I just noticed that you mentioned that there is agreement about changing "default repository" → "default remote", but not about changing "for this directory" → "for this repository". Can you please clarify?
An alternative phrasing for the latter could be "for this clone", if "for this repository" is considered too ambiguous (since there could be multiple local clones of the same repository).
SamB commentedon Sep 18, 2023
It's also not clear whether to set this to your fork or to your upstream repository.
williammartin commentedon Oct 3, 2023
@SamB, thanks for the feedback. What do you think would help you in deciding that beyond the help text that is already there?
maxandersen commentedon Jan 19, 2024
coming from #7755 I just wanna say that I would love being able to tell
ghthat if nothing else set then useoriginas the default repo (I know others preferupstream).BagToad commentedon Jan 21, 2026
Hey folks 👋
We've been going through the
help wantedcandidates in our backlog. This is an old issue that doesn't have a clear enough path forward for implementation, so @babakks and I read through this to distill some of the feedback here into something more actionable and created #12514. I'll close this one out in favour of that new issue 🙏waldyrious commentedon Sep 3, 2026
You can actually do as @minrk suggested in #6827:
That way, the "origin" remote will always be considered the default/base repository for PRs, browsing, etc.
Beware that doing so will prevent overriding the config for specific repos via
ghitself, due to #7770; however, such overrides can be added manually via git itself, e.g.git config remote.upstream.gh-resolved base, to set "upstream" as the default/base remote for the current repo.maxandersen commentedon Sep 26, 2026
I'm late for this but Thank you @waldyrious !