및 git log둘 다 --follow와 함께 사용 --patch하면 이름이 from / rename to output 인 로그가 표시됩니다. 그리고 --파일 경로 이전을 잊지 마십시오 .
git log --follow --patch -- path/to/file.ext
예를 들어 testdir/more-testing.txt내 시스템 의 파일 내역 은 다음과 같습니다.
Date: Wed Mar 18 14:48:07 2020 -0700
renamed file
diff --git a/testdir/testing.txt b/testdir/more-testing.txt
similarity index 100%
rename from testdir/testing.txt
rename to testdir/more-testing.txt
commit feb58d3ab8e8ce940f80499df0c46e8fc8caf679
Author: Igal <redacted>
Date: Wed Mar 18 14:47:18 2020 -0700
moved test.txt to subdirectory and renamed
diff --git a/test.txt b/testdir/testing.txt
similarity index 100%
rename from test.txt
rename to testdir/testing.txt
commit 34c4a7cebaeb0df5afb950972d69adea6b1a7560
Author: Igal <redacted>
Date: Wed Mar 18 14:45:58 2020 -0700
added test.txt
diff --git a/test.txt b/test.txt
new file mode 100644
index 000000000..0527e6bd2
--- /dev/null
+++ b/test.txt
@@ -0,0 +1 @@
+This is a test
(END)