0

I'm using git to manage code between my local, dev and master environment. last night I pushed some data to the master from the dev environment. Today, when I started my git, it was on the master branch and when I tried to checkout to another branch (local, dev), it gave me the message:

"error: pathspec 'newLocal' did not match any file(s) known to git".

I also tried to fetch other branches but without any luck. all I can see, when I try to check the existing branches:

$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

What should I do?

I also tried reflog, that only show one row.

UPDATE:

I noticed that the git is connecting to a .git library in the main project library (vagrant-joe) instead of connecting to the right library (vagrant-joe/www/joe) even though I am doing "cd ~/vagrant-joe/www/joe/". How can I force it to connect to the right library?

UPDATE 2: I manage to work it through by reinstalling Git-Bash. Now I have a new problem - Git does not know my VM's. When I try "vagrant up", I get "A Vagrant environment or target machine is required to run this command". Vagrant global-status comes up empty. is there anyway to reconnect the VM's to the git? I am using Oracle VM VirtualBox and Git-Bash.

  • What do you mean by "when I tried to checkout to another branch (local, dev)"? What command did you run? – jub0bs May 08 '18 at 09:40
  • I have 3 branches (3 local and 3 remote): master, local and dev. I tried to do git checkout dev. – Erez Priel May 08 '18 at 09:42
  • How did you know that you have 3 branches (3 locals and 3 remotes)? because your git branch -a is telling you that you only have local and remote master branch only. Are you looking at the right remote? `git remote -v` – letthefireflieslive May 08 '18 at 15:03
  • I can see all the branches in the correct .git/refs/heads folder. There I can see all the correct local branches – Erez Priel May 08 '18 at 15:19
  • It seems I can only connect to the main library not to to its subfolders – Erez Priel May 08 '18 at 15:32
  • Does this answer your question? [fetch in git doesn't get all branches](https://stackoverflow.com/questions/11623862/fetch-in-git-doesnt-get-all-branches) – Ictus Jun 23 '20 at 15:20

0 Answers0