Skip to content

Can't delete remote branch (or tag) when there is a tag (or branch) with the same name #5072

@miduddin

Description

@miduddin

Describe the bug

If a remote contains a branch and a tag with the same name, trying to delete one of them with lazygit will show the message "error: dst refspec <some-name> matches more than one."

I can do this with git cli using the command git push origin --delete refs/heads/<some-name> (or refs/tags/<some-name>).

To Reproduce

  1. Create a branch and a tag with the same name on a remote project.
  2. Go to "Remote branches" panel in lazygit.
  3. Delete the remote branch by pressing 'd'.

Expected behavior

Remote branch deleted successfully.

Screenshots

-

Version info:

> lazygit --version
commit=v0.56.0, build date=2025-11-01T16:13:09Z, build source=binaryRelease, version=0.56.0, os=linux, arch=amd64, git version=2.52.0

Additional context

-

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