Skip to content

Support pushing to collaborator forks #550

Closed

Description

@haacked

Today, we have this really cool way of cloning the branch of a PR from a fork.

image

This one click operation conveniently replaces a several step command line process.

Recently, GitHub also shipped the ability for collaborators working on a fork to allow authors on the target repository to push to their PR branch.

Desktop today doesn't support this. If I click "open this in GitHub Desktop" on a fork PR, make a change, and then try to push, it defaults to pushing to origin and not the fork branch.

Ideally, we would detect (I assume there's an API we can hit) if we actually have write access to the fork PR branch and if so, push to that instead. If the developer's intention is ambiguous, we could prompt asking where they would like to push.

Activity

  1. haacked commented on Oct 18, 2016

    @haacked
    ContributorAuthor

    /cc @grokys @donokuda @shana @paladique as this applies to GitHub for Visual Studio as well.

  2. shiftkey commented on Oct 19, 2016

    @shiftkey
    Member

    Ideally, we would detect (I assume there's an API we can hit)

    I'm not aware of this being made available with a preview API on the blog. There might be some new fields on the PR response that haven't landed in the developer docs but we'd also need to work out "are we a collaborator?" - or maybe that new field will do it for us.

  3. haacked commented on Oct 20, 2016

    @haacked
    ContributorAuthor

    Guess we can ping our friends in platform such as @kdaigle to find out if such a field exists, and if not, could we get one.

  4. shiftkey commented on Feb 12, 2018

    @shiftkey
    Member

    Bumping this because I think the upcoming 1.1 release (already on the beta channel) will address much of what was necessary here:

    • Desktop now lists Pull Requests in the app, including PRs from forks
    • when you checkout a PR from a fork, Desktop will set the tracking information so you can pull in new changes if the PR gets updated
    • And because of this tracking information being set, if you have permissions to push to the PR, you can make commits and push to the PR branch

    #3835 is an example of this.

    There's probably some polish here:

    • there's a maintainer_can_modify flag on PRs that's returned by the Pull Request API, we don't look at that currently
    • I think we also need to look at the permissions hash returned by the repository API, which indicates what the current user can do with the repository
  5. billygriffin commented on Jan 17, 2020

    @billygriffin
    Contributor

    Desktop does allow maintainers to push to collaborator forks of a particular repo. @outofambit and I tested it on #8934 with great success. And the problem of checking out a branch of a fork in Desktop is captured in #8509, Problem 5. I'll open up a separate issue for that to be more specific to the checkout of the PR branch from forks, but since the pushing operation is allowed, I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions