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 in Git & GitHub by MD
• 95,060 points
537 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 by akhtar
• 38,170 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,060 points
630 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
813 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
953 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,170 points
174 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,170 points
106 views