removing broken names in Git (dropbox conflicted copy)

后端 未结 3 1983
情歌与酒
情歌与酒 2020-12-31 00:38

I save my repo in dropbox, and one day (see date below) it went crazy. Now I get these warning every time I try to autocomplete a branch name

warning: ignori         


        
相关标签:
3条回答
  • 2020-12-31 00:44

    I pruned branches that were no longer on my remote by running

    git remote prune origin
    

    and that resolved the issue for me.

    0 讨论(0)
  • 2020-12-31 00:50

    when dropbox finds conflicting files, it renames those to filename (conflicted copy) (as you might know). So you just have to rename again those files:

    This might be a rather delicate exercise since you will be messing inside your git directory; better take a copy of your whole repository first. Now go into this directory

    cd <repo>/.git/refs/heads
    

    where you will find those badly renamed files. You'll have to check which one to keep (the normal or then conflicting copy), and remove the unwanted, renaming the conflicting copies as necessary. You'll have to do the same in the other directory:

    <repo>/.git/refs/remotes
    

    EDIT: each of the files you'll find just contains the hash of the commit they are pointing at. So if you want to check which one to keep; check which of the commits really exists, and where you want those references to point to.

    0 讨论(0)
  • 2020-12-31 01:06

    I got this warning possibly after updating my git version (ubuntu 15.04 to 15.10) and needed only to remove directories in .git/refs/remotes for old dangling remotes I no longer actually had configured.

    0 讨论(0)
提交回复
热议问题