18

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) '

15
  • 5
    Using Dropbox as a git repository is a really bad idea.
    – James M
    Feb 10, 2012 at 12:52
  • Yeah I know that now. I will change it. But how do I remove the conflicts ? any pointers ? Feb 10, 2012 at 12:54
  • What does refs/heads/debugging contain?
    – James M
    Feb 10, 2012 at 12:55
  • 1
    Exact same problem.. today for the very first time after 4 years of git on dropbox.. are you using SourceTree by any chance? Haven't found a solution yet though.. there's nothing offensive under refs/heads/debugging..
    – Frank R.
    Feb 10, 2012 at 13:01
  • 1
    okay, no solution but an update. I have found out that this is a draconian check introduced in a recent git revision and there's some discussion about changing it to allow users to continue using the repository.. marc.info/?l=git&m=132009090127795&w=2
    – Frank R.
    Feb 10, 2012 at 13:16

3 Answers 3

22
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 :)

0
12

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.

2
  • For your answer references our answers, you could have added this as a comment
    – 19h
    Jan 19, 2013 at 16:27
  • 11
    My idea was to help visitors the most. As a comment, this tip wouldn't get the same visibility and its formatting would be precarious.
    – pagliuca
    Jan 20, 2013 at 17:02
5

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"..

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.