Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jankeromnes opened this issue Jun 1, 2021 · 1 comment · Fixed by #4367
Closed
Labels
priority: must have This issue must be fixed before others - use sparingly type: bug Something isn't working

Comments

@jankeromnes
Copy link
Contributor

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).

@JanKoehnlein
Copy link
Contributor

@jankeromnes can you fix that? This should likely be hotfix deployed. CC @csweichel

@JanKoehnlein JanKoehnlein added the priority: must have This issue must be fixed before others - use sparingly label Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: must have This issue must be fixed before others - use sparingly type: bug Something isn't working
Projects
None yet
2 participants