gpt4 book ai didi

Git 显示文件的最后更改

转载 作者:太空狗 更新时间:2023-10-29 14:46:13 25 4
gpt4 key购买 nike

我用谷歌搜索了这个和很多文章,展示了如何查看最近几天或最后一次提交的更改。

我真正想要的是查看文件的最后一次更改,而不管提交时间和提交。

比方说,我有 FileA 和 FileB

提交 1:更改了 FileA 和 FileB

提交 2~99:更改文件 B

我想看到的是 FileA 的最后一次更改是什么,而不知道哪个提交影响了 FileA。

当我 git pull 一个共享项目时,这特别有用(至少对我而言),我看到一大堆文件被多次提交更改,我很感兴趣对某些文件进行了哪些更改,但是这有点难。

最佳答案

我会尝试

git log -1 -p -- path/to/your/file

就像 git help 说的那样:

  -<n>
Limits the number of commits to show. Note that this is a commit
limiting option.

[--] <path>...
Show only commits that are enough to explain how the files that
match the specified paths came to be. See "History Simplification"
below for details and other simplification modes.

关于Git 显示文件的最后更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25613349/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com