DropBox and GitHub: fatal: Reference has invalid format: ‘refs/heads/master

I am keeping all my code in a DropBox synchronized folder.

Besides, I keep the code in GitHub.

Well, this seems a bit redundant, but I prefer to do so because coding is an important part of my business.

But recently I experienced a problem and I want to share it with you.

I had to reformat my hard drive because of file corruption problems that could not be solved otherwise. But before I reformatted I was able to copy the files to an external hard drive. This was in a Mac OS X 10.7 Mountain Lion environment running on MacBook Pro 13”. I had to use Recovery Mode to do so.

Because I had 50+ Gbytes in DropBox, I decided to copy the info from the back-up drive to the new drive, so I did not have to wait ages to get the 700k+ files in my DropBox. And everything was fine until I realised that the local version was more recent than the DropBox one. This happened because at the time of losing my hard drive, the files in DropBox were not fully synchronised, so the local version was more recent. What I would not expect from DropBox is that it considers the on-line version to be the correct one even if the local is more recent. It should ask at least! 

How did I notice the problem? 4 days after the crash, the files finally downloaded from DropBox and replaced the local versions without asking. I think that DropBox should have a professional mode, more similar to git, where you can decide what you do in case of conflict.

So I was not able to do git pull in my code because the local HEAD did not mach the github HEAD. I was getting this error 

fatal: Reference has invalid format: ‘refs/heads/master 

Solution: I renamed the folder and created a new one from the backup hard drive. Now it seems to survive to DropBox synchronization!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s