새소식

ETC/Tip - 2023.02.23

[Git] 히스토리에서 파일 이름 변경 정보 확인하기

  • -

사용 방법

git log --follow --patch 파일명

실행 결과

  • git log --follow 파일명 만 활용한 경우
    • 파일 이름이 어떻게 변했는지 확인할 수가 없다.
git log --follow 2_바이러스.py
>>
commit d2b40f8af3740a54298d2212a91e442ba84592df
Author: ~
Date:   Wed Feb 15 21:34:14 2023 +0900

    [Rename] : solved, retry 폴더로 구분

commit e4929ce94ceae2f22d77f2a4ff0a21cff117691a
Author: ~
Date:   Tue May 17 16:52:44 2022 +0900

    Add : 2_바이러스.py
  • git log --follow --patch 파일명 을 활용한 경우
    • rename from(to) 를 통해서 파일명이 어떻게 변했는지 확인할 수 있다!
git log --follow --patch 2_바이러스.py
>>
commit d2b40f8af3740a54298d2212a91e442ba84592df
Author: ~
Date:   Wed Feb 15 21:34:14 2023 +0900

    [Rename] : solved, retry 폴더로 구분

diff --git "a/softeer/2_\353\260\224\354\235\264\353\237\254\354\212\244.py" "b/softeer/retry/2_\353\260\224\354\235\264\353\237\254\354\212\244.py"
similarity index 100%
rename from "softeer/2_\353\260\224\354\235\264\353\237\254\354\212\244.py" # 요기서 확인 가능
rename to "softeer/retry/2_\353\260\224\354\235\264\353\237\254\354\212\244.py"

commit e4929ce94ceae2f22d77f2a4ff0a21cff117691a
Author: ~
Date:   Tue May 17 16:52:44 2022 +0900

    Add : 2_바이러스.py

참고

 

Viewing Git history of moved files

Despite reading lots of other posts regarding GIT and moved files I still struggle to understand how to trace the full history. Doing gitk myfile as suggested here seems to only show history until...

stackoverflow.com

 

Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.