avatarTeri Radichel

Summarize

pathspec ‘repository’ did not match any file(s) known to git

Nonsense git error message based on the actual problem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

⚙️ Check out my series on Automating Cybersecurity Metrics | Code.

🔒 Related Stories: Bugs | AWS Security | Secure Code

💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I was writing a script to create a new github repository when I got this message:

pathspec ‘repository’ did not match any file(s) known to git

I started testing the lines of code one by one until I figured out the problem was with the line of code where I was trying to commit a ReadMe file to the new repo.

This error message doesn’t make any sense based on the problem that caused it. The problem was that I had a message for git add with spaces in it that I did not put in quotes. Spent way too long on this non-sensical error message.

In other words I had this:

m="Some message"
git commit -m $m

Instead of this:

m="Some message"
git commit -m "$m"

I wish git would fix this error to something that makes more sense.

This error message is similar to another which has a different solution — I think! It’s hard to believe those quotes above caused the problem. So try this if you are still having problems.

Follow for updates.

Teri Radichel | © 2nd Sight Lab 2023

About Teri Radichel:
~~~~~~~~~~~~~~~~~~~~
⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests, Assessments, Phone Consulting ~ 2nd Sight Lab
Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation
Follow for more stories like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
❤️ Sign Up my Medium Email List
❤️ Twitter: @teriradichel
❤️ LinkedIn: https://www.linkedin.com/in/teriradichel
❤️ Mastodon: @teriradichel@infosec.exchange
❤️ Facebook: 2nd Sight Lab
❤️ YouTube: @2ndsightlab
Error Message
Git
Pathspec
Repository
Files
Recommended from ReadMedium