yihong0618 和朋友们的频道 头像

消息来源频道

yihong0618 和朋友们的频道

@hyi0618

频道8,612 位成员公开可见0 人在线

yihong0618 和朋友们的频道

成员规模8,612 位成员
在线情况0 人在线
消息总数10,129 条消息
浏览量总数3,281,861 次浏览

在这个频道里搜索消息……

t.me/hyi0618

TIL:
Link: https://github.com/jbranchaud/til/blob/master/git/show-all-commits-for-a-file-beyond-renaming.md
📌 Show All Commits For A File Beyond Renaming
By including -- <filename> with a git log command, we can list all the
commits for a file. The following is an example of such a command with some
formatting and file names.
> git log --name-only --pretty=format:%H -- README.md
4e57c5d46637286731dc7fbb1e16330f1f3b2b7c
README.md
56955ff027f02b57212476e142a97ce2b7e60efe
README.md
5abdc5106529dd246450b381f621fa1b05808830
README.md
What we may not realize, though, is that we are missing out on a commit in
this file's history. At one point, this file was renamed. The command above
wasn't able to capture that.
Using the --follow flag with a file name, we can list all commits for a
file beyond renaming.
> git log --name-only --pretty=format:%H --follow README.md
4e57c5d46637286731dc7fbb1e16330f1f3b2b7c
README.md
56955ff027f02b57212476e142a97ce2b7e60efe
README.md
5abdc5106529dd246450b381f621fa1b05808830
README.md
ea885f458b0d525f673623f2440de9556954c0c9
README.rdoc
This command roped in a commit from when README.md used to be called
README.rdoc. If you want to know about the full history of a file, this
is the way to go.
source