Repository navigation
Description
This is a meta issue intended to clarify the landscape around problems related to forks of repositories. The primary use case for forks is to contribute to repositories where the person contributing does not have write access. However, we also need to ensure any work we do here doesn't explicitly break for people who are working in "long-running" forks that have entirely diverged from upstream.
These contributions are almost exclusively made via pull requests. This process today is confusing and Desktop can make it a lot simpler and help people get out of a bind more easily.
Problem 1: Trying to push changes to a repo you don't have write access to (issue here)
Update: Solution for this shipped in 2.3! 🚢 🎉
If you've cloned a repo and make some changes with the intent to contribute, you're basically stuck. You can't push those changes to the repo you've cloned because you don't have write access, and you can't bring them over to a fork that doesn't yet exist in a low-friction way.
Desktop could let you know you don't have write access and give you a nice pathway to fork and create a PR. This is conceptually similar to local commits to protected branches, where ideally we wouldn't allow you to do that (because you'd never be able to push those commits to that branch), and instead give you a nice path to somewhere where your work can eventually be pushed without issue.
A potential solution is outlined in #3918 by @say25.
Problem 2: "Create pull request" is still a suggestion even after I've created a pull request for the current branch on my fork (issue here)
Update: Solution for this shipped in 2.3! 🚢 🎉
After you create a PR from a branch of your fork that's targeting the upstream repo, the "Create pull request" suggestion is still displayed. This is very confusing because you already have a PR.
Example: I'm in billygriffin/desktop (a fork of desktop/desktop) on my branch new-work, and I make some commits and create a pull request targeting the development branch of desktop/desktop. In the app, I'm still shown the "Create pull request" suggested next step even though I've already created one.
Problem 3: Staying up to date on your fork with changes on upstream
Update: A partial solution to this, scoped only to when creating new branches, shipped in 2.4! 🚢 🎉
It's not at all straightforward how to pull in updates from the default branch of the upstream repo while you're working on a contributions on your forked repo. You don't necessarily know they exist, and even if you do it's not clear for people who don't do it frequently how to merge in those changes to get your branch up to date.
One way in which this manifests is when you're creating a new branch, and if there has been new work on the upstream repo, you're starting your branch out-of-date, described here by @outofambit: #7762
We also have an existing feature (notification when diverging from default branch) that was intended to solve some of this, but it's currently not working as designed. A potential path forward on that specifically is described here: #6875 (comment)
Problem 4: Viewing pull requests for the upstream repo from your fork (including your own PR) (issue here)
Update: Solution for this shipped in 2.4! 🚢 🎉
If you fork a repo and make a PR to contribute to the upstream repo, there's currently no way to view your PR in Desktop from your fork because the PR is associated with the upstream repo, not your fork of it.
After further consideration, we think that in nearly all cases, if you're working on a fork in Desktop you care most about the PRs targeting the parent repository. So we're going to show those, and it's just important to make clear to people that that's what they're seeing.
Problem 5: Cannot open a pull request from a GitHub.com PR page in your fork in Desktop (issue here)
Update: Solution for this shipped to production in 2.4 🎉 🚢
When you click "Open this pull request in Desktop," on a GitHub.com pull request page, Desktop attempts to clone the upstream repo, or opens the upstream repo if it already exists. You have to open the fork of the repo manually in the app. I'm not sure if an issue exists for this today, but if one does, please feel free to edit this and add a reference to it.
A few scenarios to consider:
- If you only have your fork in Desktop and upstream is the PR source, open it in your fork.
- If you only have your fork in Desktop and someone else's fork is the PR source, open it in your fork.
- If you have both repos (upstream and your fork) in Desktop, open the PR in the right one (based on the source of the PR).
Problem 6: Cannot check out a contributor pull request and push to it from Desktop
Update: Pushing to collaborator forks from Desktop works! ✅ 🚢 🎉
Related to the above, because you aren't able to check out a PR on a forked repo in Desktop as a maintainer, you also aren't able to push to the PR branch using the app. This is more fully described here by @haacked: #550 (we need to check to see if this is accurate)
Problem 7: It's not obvious that you're in a fork, or what the upstream repo is
We show this in the repo dropdown, but the symbol is not universally understood and there's no way to know what repository it's forked from.
Problem 8: Issue and coauthor autocompletion doesn't inherit knowledge from upstream
If you try to add a coauthor, the handles do not autopopulate from upstream repo collaborators. In addition, if you attempt to reference an issue from the upstream repo, the reference doesn't work because it's only looking for issues in the fork itself.
Notes:
- If you create a PR from your fork, "Create pull request" takes you to the "Create PR" page on GitHub.com and the PR targets the upstream default branch.

Activity
[-]Improve how Desktop handles forks[/-][+][Fork] Improve how Desktop handles forks[/+]billygriffin commentedon Jan 29, 2020
Updating this issue since 2.3 shipped to production today. Problems 1, 2, and 6 no longer exist, and we think problems 5 and 3 will be our next areas of focus here. I'm going to make another issue for Problem 5 since it doesn't have one currently.
say25 commentedon Jan 30, 2020
Big steps in the right direction. Thanks for all the work so far.
[-][Fork] Improve how Desktop handles forks[/-][+][Fork] Improve how Desktop handles forks - tracking issue[/+]billygriffin commentedon Mar 17, 2020
Update: Problem 5 and part of problem 3 (staying up to date when creating a branch) will ship in 2.4 next week and both are now on beta.
Problem 4 is next up, and problems 7 and 8 I'm a lot less concerned about for now and don't think they should be prioritized unless we see that people are struggling with them.
say25 commentedon Mar 26, 2020
Tested out the forking via GitHub Desktop for the first time in a while and ran into one majorish issue and one minorish issue.
My Steps:
https://github.com/AutoMapper/AutoMapper.Collection.EFCore.githttps://github.com/say25/AutoMapper.Collection.EFCore.gitMajorish Issue:
Its hard to tell, but note my Enterprise Gravatar pulled in the bottom left, despite the fork to my public account.
Proposed Solutions:
Tangentially Related Minor Pain Point:
Congrats
I will say, major props to handling GitHub Public vs GitHub Enterprise forking, when making a fork it has proven to determine the correct account to fork.
billygriffin commentedon Apr 16, 2020
@say25 Thanks for this! A couple things:
As a general update, I crossed out (4) above as complete since we now display the PRs from upstream. 🎉
Regarding your feedback, it sounds like the per-repo git config work that you're doing may rectify your issue above?
say25 commentedon Apr 16, 2020
Id classify it almost as a work around. To some extent, what would be ideal is when forking if it recognized the fork as for my public user
github.com/say25/repoormy GHE enterprise serverit would be amazing if this automatically happenedguidezpl commentedon Dec 16, 2020
Great progress! Regarding 2/3 remaining problems, I had a few ideas and wanted feedback.
Problem 3: Staying up to date on your fork with changes on upstream
Update <master/main> from upstreamMerge <master/main> into <master/main>button, which is always disabled when on the master/main branchProblem 7: It's not obvious that you're in a fork, or what the upstream repo is
The obvious place for it is the repository button. Mocked up:
Not the best example but since the repo name and org are the same, but the user/org you forked from is really what you care to know
tidy-dev commentedon Sep 16, 2024
Feedback about Forks and viewing branches on Forks. Similar to problem 8 on not being able to tell "fork" vs "upstream".