diff --no-index - 두 파일이 달라서 문제가 생겼는데 어느 부분이 다른지 확인할 수 있나요?

김동규·2023년 4월 26일
0

Git

목록 보기
10/15

분명 파일을 복사해서 붙여넣었고, 필요한 부분만 수정했습니다. 그런데 문제가 없어야 할 부분에서 오류가 나고 있습니다.
git diff는 일반적으로 브랜치와 브랜치, 혹은 현재의 Working Directory와 commit을 비교하는 명령이지만, --no-index옵션을 사용하면 파일과 파일 간의 비교도 가능합니다.

/* git diff --no-index <filename1> <filename2> */
git diff --no-index README.md READMEcopy.md

--no-index 명령을 생략할 수 있는 경우도 있습니다.

git diff [<options>] --no-index [--] <path> <path>

This form is to compare the given two paths on the filesystem. You can omit the --no-index option when running the command in a working tree controlled by Git and at least one of the paths points outside the working tree, or when running the command outside a working tree controlled by Git. This form implies --exit-code. Pro Git reference

profile
공식문서를 사랑하는 프론트엔드 주니어 개발자

0개의 댓글

관련 채용 정보