Home > Blockchain >  Master branch disappeared from my local code
Master branch disappeared from my local code

Time:05-13

I have a repo that I cloned a long ago and I use the master that I push to create my branches to then merge with master.

I opened visual studio and now I don't see any branch, not even master and I did not made any changes or delete any branches.

I dont make any changes using bash, just the .net git

Is there a way to get the master branch?

CodePudding user response:

In my particular case, for some reason I do not know yet, the .git hidden folder became corrupt. As stated in this question, the first answer fatal: Failed to resolve HEAD as a valid ref

Solve the issue. Pretty much clone the repository again somewhere, copy that .git (cloned), remove the original .git (in the original repository) and put the cloned one instead.

CodePudding user response:

First, fall back to command-line in order to ascertain the situation:

cd /path/to/local/repository
git status
git branch -avv

Then, check which toggle is selected in the "History view" of your Visual Studio (local branches, remote tracking branches, or tags).

  • Related