Git cannot checkout branch - error pathspec did not match any file s known to git

–1 vote

Hi Guys,

I'm unable to check out a branch in Git that I had worked on earlier. It is showing me the below message.

Git: cannot checkout branch - error: pathspec '…' did not match any file(s) known to git.
Jan 4, 2021 in Git & GitHub by MD
• 95,460 points
29,616 views

1 answer to this question.

+1 vote

Hi@MD,

You can try the git fetch command so that your local repository gets all the new info from Github. It just takes information about new branches and no actual code. After that, the git checkout should work fine.

answered Jan 4, 2021 by akhtar
• 38,260 points

Related Questions In Git & GitHub

+1 vote
1 answer
0 votes
1 answer

error: The branch 'dev1' is not fully merged.If you are sure you want to delete it, run 'git branch -D dev1'.

Hi@akhtar, When you create one new branch in ...READ MORE

answered May 10, 2020 in Git & GitHub by MD
• 95,460 points
3,112 views
0 votes
1 answer

How to do a re-merge into another branch in git

Seems like you want to rebase your ...READ MORE

answered May 7, 2018 in Git & GitHub by DareDev
• 6,890 points
2,458 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,041 views
+2 votes
1 answer
0 votes
1 answer

How to delete a remote Git tag?

Hi@MD, It is very simple to delete a ...READ MORE

answered Sep 4, 2020 in Git & GitHub by akhtar
• 38,260 points
1,128 views
0 votes
1 answer

How to reset the changes in Git?

Hi@MD, Reset command can be used to undo ...READ MORE

answered Nov 20, 2020 in Git & GitHub by akhtar
• 38,260 points
759 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP