Skip to content

[Fork] Newly created branches on forks don't have latest work from upstream #7762

Closed

Description

@outofambit

Although we maintain an upstream remote for forks cloned into GitHub Desktop, we don't use the branches fetched from it to update any of the local branches.

Put another way: "I always want a new branch I make in my fork to have the latest work in upstream."

Currently I use this workaround:

$ git checkout development
$ git pull upstream development

Activity

  1. changed the title [-]newly created branches don't have latest work in upstream[/-] [+]Newly created branches on forks don't have latest work from upstream[/+] on Jun 11, 2019
  2. changed the title [-]Newly created branches on forks don't have latest work from upstream[/-] [+][Fork] Newly created branches on forks don't have latest work from upstream[/+] on Jan 7, 2020
  3. ampinsk commented on Mar 10, 2020

    @ampinsk
    Contributor

    Based on our decision to more heavily default to contribution fork workflows in #9170 (comment), @outofambit and I thought simply defaulting to making a new branch from upstream/master made the most sense here.

    From creating a branch when you're on your fork's default branch:

    Fork-New-Branch_01

    From creating a branch when you're on any other branch on your fork:

    Fork-New-Branch_02

    Does this approach make sense? Does anyone have any input on copy here?

  4. billygriffin commented on Mar 10, 2020

    @billygriffin
    Contributor

    I think this is great @ampinsk! I'm curious if any of our external contributors who work primarily from forks (or others who work from forks) have input here too about whether this would work for your workflow. cc: @say25 @j-f1 @agisilaos @Daniel-McCarthy

    From creating a branch when you're on your fork's default branch:

    Is someone able to change this at all, or is this their only option? I generally like it, it just feels a bit risky if they don't want to pull in new things from the parent at that point, for any reason. Maybe it would be totally fine and I'm just assuming people would be either confused or want to potentially have the ability to change it.

  5. j-f1 commented on Mar 10, 2020

    @j-f1
    Contributor

    That seems like a good idea, although I do think it would be good to have the option to select the fork’s default branch for cases where someone forks a project because it’s unmaintained.

    Maybe there should be a repo-level setting to treat it as a fork or as a separate repo in its own right? That would also help with stuff like displaying PRs in the PR list, where I don’t want to see PRs on my fork.

    Not sure how common maintaining a “hostile fork” is — maybe you could get stats on that somehow (i.e. what fraction of regularly updated forks on GH have their default branch ahead of the parent’s default branch)?

  6. billygriffin commented on Mar 10, 2020

    @billygriffin
    Contributor

    Thanks @j-f1!

    Not sure how common maintaining a “hostile fork” is — maybe you could get stats on that somehow (i.e. what fraction of regularly updated forks on GH have their default branch ahead of the parent’s default branch)?

    Totally agree - from the data we've seen so far, we think it's extremely rare. Far more common for "maintained" forks is that they become their own repo entirely separate from the parent.

    Maybe there should be a repo-level setting to treat it as a fork or as a separate repo in its own right? That would also help with stuff like displaying PRs in the PR list, where I don’t want to see PRs on my fork.

    Agreed! We're thinking about that as well as part of #9170. We're not positive about a repo setting given what we shared above, and wondering whether we can just safely assume that the vast majority of people care about their fork only in the context of contributing to the parent repo.

  7. say25 commented on Mar 10, 2020

    @say25
    Member

    What about:

    1. Using Repository settings to change the default target branch for forks?
    2. Providing upstream/default-branch, origin/default-branch, current-branch (if applicable) as the options?

    I think that the general case of upstream/default-branch (master in most cases) makes sense but I'm fine with the approach described above

  8. billygriffin commented on Mar 11, 2020

    @billygriffin
    Contributor

    @say25 We were initially thinking a repo setting might be appropriate as well, and we're still not opposed to that, but after digging into the data and talking to people, we think that just assuming that forks are "Contribution forks" using @ampinsk's framework here might just work, so we might start with that and move toward a repo setting if we see evidence that there's a fairly significant number of people who are using "Maintained forks" with Desktop. At the very least, it's nice to know that that default assumption would seem to make the experience better for y'all. Thanks!

  9. say25 commented on Mar 11, 2020

    @say25
    Member

    @billygriffin that makes perfect sense to me, I think in general "Contribution Forks" are the expected workflow

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions