[git] 에러 did not match any file(s) known to git 해결

yeseo·2025년 2월 28일

git

목록 보기
1/3

⚠️ 문제

git에 새 프로젝트를 커밋하려고 하는데 해당 오류가 발생했다. 깃 정보가 동기화되지 않아서 자주 발생하는 문제라고들 하는데 나는 새로운 repository를 생성해 첫 커밋을 하는것이었다.

(base) yeseo@yeseo i-gacha-backend % git commit "Init: Spring 초기 설정"
error: pathspec 'Init: Spring 초기 설정' did not match any file(s) known to git

⁉️ 원인

내가 작성한 명령어를 자세히 살펴보니 문법오류가 있는 것을 확인했다. commit 뒤에 -m이 빠져있었다.


🙆‍♀️ 해결

올바른 문법인 git commit -m "" 형태로 다시 작성했다.

(base) yeseo@yeseo i-gacha-backend % git commit -m "Init: Spring 초기 설정"
[main (root-commit) c4f8f12] Init: Spring 초기 설정
 28 files changed, 955 insertions(+
 ...

🔅 결론

명령어 작성할 때 꼭 빠뜨린게 없는지 다시 한 번 확인해보자...!

0개의 댓글