Reputation: 1841
Can somebody tell me how to get back to my main Git root directory? My command prompt was pointing to
c:/Sites
but now, the command prompt is pointing to:
c/Sites (new_branch)
Not sure how I got there but I suspect that I must have accidentally created a new branch. I tried "git branch" but returned no results. Also tried "git checkout master" but got an error: "pathspec master did not match any file(s) known to git."
I'm on windows 7. Thanks!
Upvotes: 0
Views: 601
Reputation: 811
Since, you do not see anything with ls -l .git/refs/heads , it implies that you no longer have master branch (may be you deleted your master branch unknowingly as you said above you weren't sure when you accidentally created your branch.
To go back to your original master branch, check your git log for when you created the new branch. once you obtain the commit sha , recreate you master branch with "git checkout -b master ". This will take you to your default prompt.
Upvotes: 1
Reputation: 5327
This means that your directory is now tracked by Git. Since you have that error try to do:
git checkout new_branch
Alternatevely
git checkout -b master
Upvotes: 1
Reputation: 5190
You should be able to do
git checkout master
to go back to master..
Upvotes: 0