Skip to content

gh repo fork broken in v1.5 #2904

Closed

Description

@jetersen

seems #1882 has broken the previous behavior...
you used to be able to write gh repo fork and the origin would become upstream and your fork would become origin

Reason for the behavior
I use to run gh repo clone some/repo to start messing with the code to solve a problem than once ready to run gh repo fork

So this is changing the previous behavior, right? If you cloned a repo from origin, then added a fork, you would have the old origin be added to the upstream remote, and the new >origin would be your fork. As I understand, this isn't possible anymore:

https://asciinema.org/a/DRebWnUq73hVcNAY8lZdVXolV

As much as I like having the option to pass a name, this is marked as an addition, but it's also a feature removal, and it'll be missed :c

Originally posted by @kubukoz in #1882 (comment)

Activity

  1. added
    bug
    on Feb 9, 2021
  2. mislav commented on Feb 10, 2021

    @mislav
    Contributor

    Apologies for changing the behavior of this command abruptly. We've received feedback that renaming the remote was undesirable and we wanted to switch to a less "magic" behavior where the user keeps more control over how they organize their remotes.

    Because the original behavior is still kept in non-interactive mode for scripts, you can opt into it by doing gh repo fork --remote | cat (or otherwise redirecting stdout).

  3. kubukoz commented on Feb 10, 2021

    @kubukoz

    Because the original behavior is still kept in non-interactive mode for scripts, you can opt into it by doing gh repo fork | cat (or otherwise redirecting stdout).

    Not really. I didn't have any remote created when using this in a non-interactive way.

    image

  4. mislav commented on Feb 10, 2021

    @mislav
    Contributor

    @kubukoz Thank you for trying, and sorry for the misleading instructions. I forgot the flag: gh repo fork --remote | cat

  5. kubukoz commented on Feb 10, 2021

    @kubukoz

    a remote called 'origin' already exists. You can rerun this command with --remote-name to specify a different remote name.

    😅

  6. mislav commented on Feb 10, 2021

    @mislav
    Contributor

    @kubukoz Well, thank you for trying again, and sorry again for sending you on a wild goose chase. It turns out that the backwards-compatible fix for scripting landed after a tagged release 1fa3047, so it will only be available after the next release.

  7. Xerkus commented on Feb 11, 2021

    @Xerkus
    Contributor

    Different behavior for non-interactive variant sounds like a really big problem, worse than no fix at all tbh. Scripting is not where you want to get surprises.

  8. added
    priority-2
    on Feb 16, 2021
  9. self-assigned this
    on Feb 16, 2021
  10. jetersen commented on Feb 17, 2021

    @jetersen
    Author

    @vilmibm and @mislav thanks for restoring behavior. That's awesome 😎 🚀 :shipit:

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

Metadata

Metadata

Assignees

Labels

bugpriority-2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions