GIT error: pathspec 'master' Did not match any file(s) known to git

Asked

Viewed 3,254 times

-1

I need help. I don’t know much about git and I’ve started to move it now. Somehow I created a new branch and now I can’t get back to the master branch. Error appears: pathspec 'master' Did not match any file(s) known to git. And the worst is that I created this branch by accident. It does me no good. And I can’t even delete it. I’m really lost. If someone has some stuff on git to tell me tbm, I’ll graduate.Tela do git

4 answers

0

Try deleting the folder manually, then open the terminal at the place where it used to be and run:

 git clone link

instead of "link" put the cloud link to your repository. If you use Github just go to the repository, copy the browser link and paste it into the terminal, this way it will copy the last uprated version and then you can redo the code updates you want. To avoid problems, before you push, get in the habit of git pull to download updates that were uploaded by someone else and not generate version conflicts

0

In that case you can make one git fetch and see what is returned from the remote environment and then give a git branch to list the branchs that exist on your site.

  • Hey. Thanks. Dude, I used git fetch and didn’t get back to me. And when I used git branch I didn’t return anything.

  • 1

    So it means there is no branch you want. It only exists locally, so you can send it to remote. git push origin bug-456

0

you can use git branch to list later git checkout {NOME_BRANCH}, go back the last commit but keep the information git reset HEAD~1.

For your convenience I recommend using the graphical version of git available on:

[https://desktop.github.com/][1]

I hope I’ve helped.

  • Hi. Thanks. When I use git branch, you don’t list any branch for me. And on github desktop you only see the master branch. And this "bug-456" branch is like it doesn’t exist.

  • you could do a test clone the repository again, and see if this branch is coming from the master.

-1

Maybe this can fix:

git remote update
git fetch
git checkout --track origin/"BRANCH-NAME"

Also, you need to verify that the branch was created for the correct repository. If you try to checkout the wrong folder/repository will give this error.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.