Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git commit error: pathspec 'commit' did not match any file(s) known to git #2052

Closed
boi87 opened this issue Feb 27, 2019 · 9 comments
Closed

Comments

@boi87
Copy link

boi87 commented Feb 27, 2019

Possible dupe of #847 ?
Thanks for cmder, I've been trying it for about a week and I came across an issue while committing.

git add . works, then
git commit -m 'header works'
returns this:
git commit error: pathspec 'header' did not match any file(s) known to git
git commit error: pathspec 'works' did not match any file(s) known to git

if I then try
git push origin header
returns
already up-to-date
which is not true 😭

with git bash the commit goes through without issues and so does the push attempt.
Is there any fix for this?

thanks very much guys!

@daxgames
Copy link
Member

Single quotes cannot be used in cmd.exe sessions.

@boi87
Copy link
Author

boi87 commented Feb 27, 2019

Single quotes cannot be used in cmd.exe sessions.

@daxgames
Thanks.
So what can I use when committing? Double quotes? Brackets and single quotes? No quotes?

@daxgames
Copy link
Member

git commit -m "Double quotes"

@boi87
Copy link
Author

boi87 commented Feb 27, 2019

Thanks pal, very useful!

@Mauroquil-bit
Copy link

Me aparece el mismo error, ya probé comillas simples y dobles y nada,

$ git commit -m index.html "mensaje" error: pathspec 'mensaje' did not match any file(s) known to git

@daxgames
Copy link
Member

daxgames commented Dec 8, 2020

Try git add index.html && git commit -m "mensaje"

@doubleogadoga
Copy link

Wow it worked, i used double quotes and it committed. Thanks.

Single quotes cannot be used in cmd.exe sessions.

@isaacton
Copy link

i used double quotes it did not work.

@chrisant996
Copy link
Contributor

i used double quotes it did not work.

@isaacton What was the full command line that was used?
What was the expected behavior?
What was the actual behavior that happened instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants