Skip to content

"entry is not unique due to being a multivar" #2700

Description

@amiantos

I've recently started getting this error often when I am trying to delete local branches within GitUp, it does not seem to happen to every branch, just some branches. It does not appear to be dependent on a specific git repo, it happens in all my git repos. It didn't start happening to me until one or two updates ago. I can successfully delete any branches this happens to via git CLI, the error seems to be GitUp specific. A quick google suggests it may be coming from libgit2...?

Image

Activity

  1. Cykelero commented on Apr 28, 2025

    @Cykelero
    Contributor

    That error seems to occur when reading Git config variables that are structured in an unexpected way, specifically. Could you share (the non-sensitive parts of) your Git config?

    The next time GitUp shows this error, open the repo in a Terminal and run:

    git config --list --show-origin
    
  2. amiantos commented on Apr 28, 2025

    @amiantos
    Author

    That error seems to occur when reading Git config variables that are structured in an unexpected way, specifically. Could you share (the non-sensitive parts of) your Git config?

    The next time GitUp shows this error, open the repo in a Terminal and run:

    git config --list --show-origin
    
    file:/Library/Developer/CommandLineTools/usr/share/git-core/gitconfig   credential.helper=osxkeychain
    file:/Library/Developer/CommandLineTools/usr/share/git-core/gitconfig   init.defaultbranch=main
    file:/Users/amiantos/.gitconfig user.name=amiantos
    file:/Users/amiantos/.gitconfig user.email=bradroot@me.com
    file:.git/config        core.repositoryformatversion=0
    file:.git/config        core.filemode=true
    file:.git/config        core.bare=false
    file:.git/config        core.logallrefupdates=true
    file:.git/config        core.ignorecase=true
    file:.git/config        core.precomposeunicode=true
    file:.git/config        remote.origin.url=git@github.com:amiantos/postalgic.git
    file:.git/config        remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
    file:.git/config        branch.main.remote=origin
    file:.git/config        branch.main.merge=refs/heads/main
    file:.git/config        branch.main.vscode-merge-base=origin/main
    file:.git/config        branch.s3-publish.vscode-merge-base=origin/main
    file:.git/config        branch.s3-publish.vscode-merge-base=origin/main
    file:.git/config        branch.s3-publish.github-pr-owner-number=amiantos#postalgic#4
    

    Similarly in another repo where I get the same issue, this is the config for two branches that displays the same error.

    file:.git/config        branch.fix-soft-upgrade.vscode-merge-base=origin/master
    file:.git/config        branch.fix-soft-upgrade.vscode-merge-base=origin/master
    file:.git/config        branch.fix-soft-upgrade.remote=origin
    file:.git/config        branch.fix-soft-upgrade.merge=refs/heads/fix-soft-upgrade
    
    file:.git/config        branch.fix-canceled-sub-editor-change.vscode-merge-base=origin/master
    file:.git/config        branch.fix-canceled-sub-editor-change.vscode-merge-base=origin/master
    file:.git/config        branch.fix-canceled-sub-editor-change.remote=origin
    file:.git/config        branch.fix-canceled-sub-editor-change.merge=refs/heads/fix-canceled-sub-editor-change
    file:.git/config        branch.fix-canceled-sub-editor-change.github-pr-owner-number=[removed]
    

    Looks to me like the similarity is that there are multiple of the vscode-merge-base entry in all of them... the branches I can delete successfully do not have two entries.

    Let me know if there is anything else I can do to help debug.

  3. Cykelero commented on May 4, 2025

    @Cykelero
    Contributor

    Thanks for the details! I was able to reproduce locally by adding duplicate config options, like in your setup.

    This does look like this is a libgit2 issue: GitUp calls git_branch_delete, which tries to delete config related to the branch, and that fails for this variable because it has multiple values.

    Of note, #2683 kind of fixes the issue: with that PR, deleting the branch still fails (now with a could not find key 'XXX' to delete error), but does remove the config options, so it succeeds the next time you attempt it.

    We should open an issue with libgit2, since that's where the actual bug seems to live.

  4. mchccc-allears commented on Jan 21, 2026

    @mchccc-allears

    Hello, I'm here with the same issue, and apparently the same cause (duplicated entries with suspicious "vscode" tags.. I say suspicious because even if I do have Cursor running I'm 100% not using its git features as I'm fully into GitUp)

    file:.git/config        branch.mccc/es9.remote=origin
    file:.git/config        branch.mccc/es9.merge=refs/heads/mccc/es9
    file:.git/config        branch.mccc/es9.vscode-merge-base=origin/master
    file:.git/config        branch.mccc/drop_imported_date.remote=origin
    file:.git/config        branch.mccc/drop_imported_date.merge=refs/heads/mccc/drop_imported_date
    file:.git/config        branch.mccc/remove_paginated_search.vscode-merge-base=origin/master
    file:.git/config        branch.mccc/remove_paginated_search.vscode-merge-base=origin/master
    

    #2683 says "merged", but I'm seeing the same error message as OP and it doesn't work on the second try.

  5. lucasderraugh commented on Jan 21, 2026

    @lucasderraugh
    Collaborator

    @mchccc-allears Are you on the continuous channel build or stable? The changes are only in the continuous channel at the moment.

  6. mchccc-allears commented on Jan 21, 2026

    @mchccc-allears

    oh, sorry, I didn't realize.. yes I'm stable

  7. lucasderraugh commented on Jan 21, 2026

    @lucasderraugh
    Collaborator

    No worries, we had a long gap where I wasn't pushing updates. Hoping to update the stable build in the coming weeks.

    Let me know if it fixes the issues.

  8. mchccc-allears commented on Jan 21, 2026

    @mchccc-allears

    it did work as advertised :D

    thank you

  9. amiantos commented on Jan 22, 2026

    @amiantos
    Author

    Seeing these new comments, I switched to the continuous channel and now when I try to delete my local branches I get the error could not find key 'branch.<branch-name>.github-pr-owner-number' to delete instead of the multivar error... weird!

  10. lucasderraugh commented on Jan 22, 2026

    @lucasderraugh
    Collaborator

    @amiantos Not sure how easy it is to setup a git repo that has the configs locally defined that break this. Would love to be able to debug the case for you.

  11. amiantos commented on Jan 22, 2026

    @amiantos
    Author

    @amiantos Not sure how easy it is to setup a git repo that has the configs locally defined that break this. Would love to be able to debug the case for you.

    From a google the github-pr-owner-number tag comes from the GitHub extension from VS Code, I don't think there is any special remote configuration I am using, as this happens across my personal repos and professional ones. I assume I would not be alone in this, but I suppose there might not be that many people who use GitUp and VSCode with the Github extension. But I think all that is needed to reproduce it would be to open a PR in GitHub for a branch, look at the PR inside VSCode, and then close the PR and have GitHub delete the remote branch.

  12. amiantos commented on Jan 22, 2026

    @amiantos
    Author

    Might be easy to fake it...

    Image

    I went into my git config and manually erased those GitHub pr lines and was able to delete the branch. So maybe I just write a script to edit my git configs to remove these keys for now. But to test I bet we could just add those keys with random data to any local branch and it should reproduce I bet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions