ex)
git rm --cache 파일명
ex)
git checkout 파일명
해당 명령어를 입력하면 파일이 수정 전 상태로 돌아가고 modified 상태에서 unmodified 상태로 돌아감
git commit -am second.html(신규파일)
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
second.html
nothing added to commit but untracked files present (use "git add" to track)
해당 에러가 발생 신규 파일은 반드시 초기 add(스테이지 등록)
git commit --allow-empty-message -m ''
git commit --amend
vi
change commit!! <-- 해당 문구변경
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date: Wed Oct 21 21:34:38 2020 +0900
#
# On branch master
# Changes to be committed:
# modified: index.html
#
# Changes not staged for commit:
# modified: second.html
#
• -p 옵션: diff 기능(수정한 라인 비교)을 같이 포함하여 출력할 수 있습니다.
• --stat 옵션: 히스토리를 출력합니다.
• --pretty=oneline 옵션: 각 커밋을 한 줄로 표시합니다.
• git log (파일명): 특정 파일의 커밋 전체 로그를 볼 수 있음
• tracked 상태의 파일과 스테이지의 마지막 변경 내용과 비교하여 수정된 부분을 보여줌.(modified 상태의 파일만 가능, 즉 수정후 스테이지에 올리지 않은 파일)
• 스테이지에 올라간 파일도 git diff HEAD 명령어로 수정된 부분을 보여줌