Darren Wainwright
Darren Wainwright

Reputation: 30727

Visual Studio using TFS GIT error when connecting

I've been using VS 2013, ad have been successfully connected to our in-house Team Foundation Server for the last several months.

My machine lost power, then on rebooting I can now not connect to the server.

I receive the error below

An error occurred. Detailed message: An error was raised by libgit2. 
Category = Reference (Error). Corrupted loose 
reference file: refs/remotes/origin/master

I can, in the command line, switch between branches just fine - though not sure if thats switching my local version? - pretty new to GIT.

When i look at the files, 'Development' and 'Master' in my .git/repo folder the master one has an empty string (i can highlight a bunch of spaces) - the development one is just fine and has a guid in place. Is this the issue? if so, how do i rectify it?

How can I rectify the above error - or even find out what it actually means?

Upvotes: 6

Views: 2323

Answers (2)

Edward Thomson
Edward Thomson

Reputation: 78673

The file containing the branch information on your server has become corrupted.

Delete the file .git/refs/remotes/origin/master then fetch from your server to recreate it.

Upvotes: 8

The easiest way to solve the problem may be to remove the corrupt repository. You can simply delete your local Git repo and clone the server again.

Note: If you have edits you have not pushed they will be lost. You can just back these up if they are not large edits.

Upvotes: 0

Related Questions