Git conflicted copy error while cloning a repository

邮差的信 提交于 2019-12-03 15:20:15

问题


I am using dropbox as a git repository.

Now due to some issue in the syncing, there is some conflicted copy present in the git. How do I remove this conflict ? Due to this conflict I am unable to clone the contents of that repository.

The error I am getting while cloning the repository is:-

Git :- fatal: Reference has invalid format: 'refs/heads/debugging (xyz conflictedcopy date) '


回答1:


The solution that eventually worked for me was to simply delete the branch that the reference refers to, e.g.

git branch -D "debugging (xyz conflictedcopy date)"

I had many such references, so it was "rinse and repeat"..




回答2:


Just delete every file in <Repo>/.git/ which ends in (... conflictedcopy <date>).

That will clean your git repo; the answer by Frank R. does in fact the same, while keeping the other by Dropbox abused files :)




回答3:


A quick way to apply the solutions from kenansulayman and Frank R. is with the following command, that should be ran from the root of the defective repository:

find .git -name '*conflicted*' -exec rm {} \;

Notice: I assume you don't have any branches, tags (or some other git object) with the string conflicted in their names. If you do, that command will also delete those wanted files.

That worked for me. Cheers.



来源:https://stackoverflow.com/questions/9227820/git-conflicted-copy-error-while-cloning-a-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!