1

I messed up my local master branch, so I had to delete it. However, I tired to pull it down, but it did not work. I tried git fetch origin master, then git checkout master. It gave me this error error: pathspec 'master' did not match any file(s) known to git. However, I think I fetch correctly because I got this message

From https://url
 * branch            master     -> FETCH_HEAD

Does anyone know how to fetch down the master branch from bitbucket ?

Max Doung
  • 221
  • 3
  • 14
  • Refer to - https://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide It is the most comprehensive guide on the internet. You don't need to look else where – Kishor Kundan Sep 22 '17 at 02:28
  • you can just delete local repo and clone it from bitbusket – Alexan Sep 22 '17 at 02:53

1 Answers1

1

I tried to reproduce your issue on my computer with the lastest version of git. I deleted my local master branch, then do git fetch && git checkout master again, it works fine.

In your case, if you're using a "old" version of Git, then try the equivalent checkout to git checkout <branch>:

git checkout -b <branch> --track <remote>/<branch>

(you run: git checkout -b master --track origin/master)

Viet Hoang
  • 51
  • 4