태그 보관물: commit

commit

단일 파일 / 디렉토리를 커밋하는 방법 ‘MY MESSAGE’ did not match any

다음 명령을 시도했습니다 :

git commit path/to/my/file.ext -m 'my notes'

자식 버전 1.5.2.1에서 오류가 발생합니다 :

error: pathspec '-m' did not match any file(s) known to git.
error: pathspec 'MY MESSAGE' did not match any file(s) known to git.

단일 파일 또는 디렉토리 커밋에 대한 잘못된 구문입니까?

답변 : 이 순서대로
인수 예상되었습니다 …

git commit -m 'my notes' path/to/my/file.ext

업데이트 : 더 이상 엄격하지 않습니다 🙂



답변

당신의 주장은 잘못된 순서입니다. 을 시도 git commit -m 'my notes' path/to/my/file.ext하거나보다 명확하게하려면 git commit -m 'my notes' -- path/to/my/file.ext.

또한 git v1.5.2.1은 4.5 세입니다. 최신 버전으로 업데이트 할 수 있습니다 (1.7.8.3이 현재 릴리스 임).


답변

시험:

git commit -m 'my notes' path/to/my/file.ext

답변

파일이 들어있는 폴더에있는 경우

git commit -m 'my notes' ./name_of_file.ext

답변

-o옵션을 사용하십시오 .

git commit -o path/to/myfile -m "the message"

-o,-지정된 파일 만 커밋


답변

다음과 같이 커밋 메시지를 입력 한 후 경로를 지정하십시오.

git commit -m "commit message" path/to/file.extention

답변

Windows 7의 git 1.9.5 : “my Notes”(큰 따옴표)가이 문제를 해결했습니다. 필자의 경우 파일을 -m ‘message’앞 또는 뒤에 넣습니다. 차이가 없었다. 작은 따옴표를 사용하는 것이 문제였습니다.


답변