본문 바로가기
Git

[Git 깃] git blame

by 까망 하르방 2022. 8. 7.
반응형
git blame

특정 코드가 누가, 언제, 어떤 Commit으로

변경했는지 확인할 수 있는 명령어

git blame {파일명}

 

author와 timestamp 출력 X

git blame -s {파일명}

 

특정 라인[start, end] 까지만 확인

git blame -L {start},{end} {파일명}

 

Commit Hash 값으로 변경 정보 확인

git show {Commit ID}

📌 [Git 깃] git show

 

[Git 깃] git show

git show Commit 변경 사항과 Metadata(Hash 값, Commit Message, 수정된 파일 목록, 변경 내용 등) 표시 현재 Branch의 가장 최근 커밋 정보 확인 git show 특정 커밋 정보 화인 git show {Commit Hash} HEAD..

zoosso.tistory.com

 

시뮬레이션
git blame {파일명}

소스 코드 원본git blame 결과

Commit ID, 변경한 사람, 변경 시간, 라인 번호, 파일 내용이 보여진다.

 

 

+ Tips

파일명의 경우 임의로 변경점을 만들어서

git status 로 [Path + 파일명]을 확인하면 빠르다.

📌 [VS Code] Git 관련 Extension

 

[VS Code] Git 관련 Extension

GitLens: VS Code 내에서 Git과 관련해서 여러 사항을 보여준다. ex) 해당 Code를 최근 Commit한 사람이 누구이며 언제인지 Git History: VS Code 내에서 Git 기록을 볼 수 있다.

zoosso.tistory.com

 

 

author와 timestamp 출력 X

git blame -s {파일명}

git blame -s

 

 

특정 라인[start, end] 까지만 확인

git blame -L {start},{end} {파일명}

git blame -L

 

 

Commit Hash 값으로 변경 정보 확인

git show {Commit ID}

git show

 

 

📌 변경 이력 비교하는 방법으로 git diff 참고

 

[Git 깃] git diff

git diff 파일의 변경 내용을 전/후 비교해볼 수 있는 명령어이다. Git에서는 원격과 merge되기까지 여러 단계를 거쳐 간다. ※ [Git] 영역 (Working Directory / Index / Repository / Stash) 어떤 파일이 추적..

zoosso.tistory.com

 

 

📌 Git 목록

 

[까망] Git 목록

본 블로그에 작성된 Git 관련 내용 URL을 정리한 곳입니다. 목록 [Git] "git add -p" 를 활용하는 이유 [Git] .gitignore 설정 [Git] learngitbranching 답안 및 풀이 - 1 [Git] learngitbranching 답안 및 풀이 -..

zoosso.tistory.com

반응형

'Git' 카테고리의 다른 글

[Git 깃] git alias  (0) 2023.01.28
💻 [Git 깃] 영역별(add, commit, push) 되돌리기  (0) 2022.08.02
[Git 깃] git revert  (0) 2022.07.31
[Git 깃] git reset  (0) 2022.07.29
[Git 깃] git rebase 위험성  (0) 2022.05.22

댓글