Repository navigation
Description
Please describe the problem you think should be solved
When adding a GitHub repository that's a fork (identified via the API), Desktop will add an upstream remote if needed:
desktop/app/src/lib/stores/app-store.ts
Lines 4049 to 4057 in 57b5373
| private async addUpstreamRemoteIfNeeded(repository: Repository) { | |
| const gitStore = this.gitStoreCache.get(repository) | |
| const ignored = await this.getIgnoreExistingUpstreamRemote(repository) | |
| if (ignored) { | |
| return | |
| } | |
| return gitStore.addUpstreamRemoteIfNeeded() | |
| } |
The context for this change is #3199 and #2364, which has been built upon to help support fork workflows like merging in changes from the upstream project.
However there's no place in the Repository Settings UI where we show this value. We only show the "primary remote URL" here:
desktop/app/src/ui/repository-settings/remote.tsx
Lines 15 to 29 in 3f2084e
| export class Remote extends React.Component<IRemoteProps, {}> { | |
| public render() { | |
| const remote = this.props.remote | |
| return ( | |
| <DialogContent> | |
| <div>Primary remote repository ({remote.name})</div> | |
| <TextBox | |
| placeholder="Remote URL" | |
| value={remote.url} | |
| onValueChanged={this.props.onRemoteUrlChanged} | |
| /> | |
| </DialogContent> | |
| ) | |
| } | |
| } |
While this is a relatively minor thing, I think the app could do better here and show this value because it's a change to the repository that the application introduced.
[Optional] Do you have any potential solutions in mind?
If:
- this is a valid GitHub repository
- it's marked as a fork when we query the GitHub API
- it has the
upstreamremote set
We should show this value in the settings dialog. It should be readonly to prevent accidentally changing the value and breaking the app (I think we could also do this for all GitHub repositories but that's out of scope for this discussion).

Activity
borpin commentedon Feb 19, 2019
Key words are "When adding". These repositories I have, have been added a while ago. Could a check be made, when opening the repository, for an upstream?
Yes if you either do a check, or if you provide the means to force a check (legacy).
Of course you can add an upstream manually through the CLI.
wolftales commentedon Apr 9, 2020
I tried opening up the CLI and got this error:
I checked repo settings and as listed by this bug, it isn't shown.
If I'm following the bugs - the remote upstream is there somewhere, but hidden. Which would mean the command I ran was adding a duplicate which resulted in the error.
I'm adding a forked repo within GitHub Desktop to track a code repo for a book in development (meaning I anticipate updates and changes).
Sounds like everything might be fine, but I vote for something to help build confidence this is working properly.
I found this command to verify on CLI to confirm everything is configured as it should be:
Show the upstream remote's URL in Repository Settings
Show the upstream remote's URL in Repository Settings
Show the upstream remote's URL in Repository Settings