Skip to content

PR merge should switch to the base branch instead of the default branch. #1096

@sammarks

Description

@sammarks

Describe the bug

When merging a pull request, currently the CLI switches to the default branch of the repository instead of switching to the base branch of the PR.

gh --version

gh version 0.9.0 (2020-05-26)
https://github.com/cli/cli/releases/tag/v0.9.0

Steps to reproduce the behavior

  1. Create a PR against a branch other than master gh pr create --base other-branch
  2. Merge the PR gh pr merge
  3. Select the option to delete the local / remote branches.
  4. gh will take you back to master

Expected vs actual behavior

I would think it would be more convenient to switch to the base branch of the PR (other-branch) instead of the default branch of the repository (master). More often than not you'll probably want to either view the merged code with the rest of the code, or start working on another PR off that same base branch, be it an epic, etc.

I classified this as a bug because I would consider it a UX bug as the behavior wasn't what I was expecting.

Original PR: #1095

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