Skip to content

Breaking behavior change: pushing topic branch to wrong remote #1762

@heaths

Description

@heaths

Describe the bug

I've been testing gh for quite a while now, and even in v0.12.0 when I ran gh pr create -w the branch was pushed to my origin remote automatically. I was never asked (my clone uses origin for my fork and upstream for the main). Now in v1.0, I was asked:

Which should be the base repository (used for e.g. querying issues) for this directory?

It listed both endpoints, and since the message above reads, "e.g. for querying issues", I chose upstream.

It then printed and acted on accordingly,

Opening github.com/Azure/azure-sdk-for-net/compare/master...issue15108 in your browser.

That's not where my topic branch was even pushed to manually and has a tracking branch set up. I previously ran git push -u origin issue15108 which completed successfully.

Steps to reproduce the behavior

  1. Make changes and commit to repo
  2. Push topic branch to origin with tracking branch set up
  3. Run: gh pr create -w

Expected vs actual behavior

  • Expected: Browser is opened with my topic branch on my origin targeting master on upstream
  • Actual: Browser is opened with my topic branch name from upstream targeting master, and topic branch does not exist in upstream.

Logs

Nothing more was printed than what I typed above.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds-investigationCLI team needs to investigate

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions