Skip to content

When opening an issue in Gitpod, the IDE now wants to push to the wrong upstream branch #4366

@jankeromnes

Description

@jankeromnes

Bug description

gitpod-push-to-wrong-branch

Credit: @jbicker

Steps to reproduce

  1. Open an issue in Gitpod
  2. Make a commit
  3. Click on "Push/Pull" in the status bar

⚠️ By default, the commit gets pushed to origin's default branch.

Expected behavior

Instead, the commit should be pushed to a new origin branch, with the same name as the local "issue" branch.

Example repository

No response

Anything else?

Likely a regression from #4167 which added a remote tracking branch to local issue-context branches:

} else if ws.TargetMode == LocalBranch {
// checkout local branch based on remote HEAD
if err := ws.Git(ctx, "checkout", "-B", ws.CloneTarget, "origin/HEAD"); err != nil {
return err
}

Judging from the git-checkout docs, it seems we could simply add --no-track to preserve the old semantics (i.e. no remote tracking branch for local issue-context branch).

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: must haveThis issue must be fixed before others - use sparinglytype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions