Skip to content

Git fast forward branch to remote fails when there's the same tag name #2625

@Neko-Box-Coder

Description

@Neko-Box-Coder

Describe the bug
Git fast forward branch to remote fails when there's the same tag name because we didn't specify the fetch command to be a branch.
This is pretty similar to #2546

It failed with

error: cannot update ref 'refs/head/<branch name>': trying to write non-commit object <tag hash with same branch name> to branch 'refs/heads/<branch name>'

To Reproduce
Steps to reproduce the behavior:

  1. Create a tag that has the same name as the branch, and push it.
  2. Try to fast forward the branch with same name to upstream

Expected behavior
The branch with the same name as the tag should be fast-forwarded successfully

Screenshots
If applicable, add screenshots to help explain your problem.

Version info:
lazygit --version: commit=v0.36.0, build date=2022-11-15T07:26:07Z, build source=binaryRelease, version=0.36.0, os=linux, arch=amd64, git version=2.38.1
git --version: git version 2.38.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions