Skip to content

Critical issue: changing branches while pushing to a new branch can mix-up merge configuration #4207

@peppy

Description

@peppy

Describe the bug

If you change branch while pushing a branch, it is possible that the old and new branch are now linked to the same branch on the remote.

I've hit this four times so far, sometimes with severe unexpected implications (pushing commits publicly that I never intended to).

To Reproduce
Steps to reproduce the behavior:

  1. Create a new branch from a branch that already has an upstream set
  2. Push the new branch
  3. While the push operation is in progress, switch back to the previous branch
  4. Observe broken configuration

Screenshots

kitty.2025-01-24.at.09.09.21.mp4

Version info:

lazygit --version
commit=, build date=, build source=homebrew, version=HEAD-40d6800, os=darwin, arch=arm64, git version=2.48.1

❯ git --version
git version 2.48.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions