Skip to content

gh pr create creates branch in *upstream* not *origin* #464

Description

@edwarnicke

Describe the bug

gh pr create

creates a branch in upstream not origin.

Note: This happens even if I've already pushed the branch to origin. Can find no way of preventing this behavior.

Steps to reproduce the behavior

  1. Create local branch
  2. Commit to local branch
  3. gh pr create

This was a most unpleasant surprise.

Expected vs actual behavior

Expected behavior:

Create branch in origin and pull PR from origin branch to upstream

Actual behavior:

Create branch in upstream and create PR from upstream branch to upstream

Logs

gh pr create

Activity

  1. edwarnicke commented on Feb 15, 2020

    @edwarnicke
    Author

    Duplicate of #392

  2. mislav commented on Feb 17, 2020

    @mislav
    Contributor

    I'm sorry for the most unpleasant suprise. We plan to improve the case when you have already pushed the branch yourself:

    cli/command/pr_create.go

    Lines 97 to 98 in 08811c1

    // TODO: respect existing upstream configuration of the current branch
    if err := git.Push(headRemote.Name, fmt.Sprintf("HEAD:%s", headBranch)); err != nil {

    Thank you for reporting!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions