gpt4 book ai didi

git - "git whatchanged -- filename"和 "git rev-list -- filename"有什么区别

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

下面两个命令有什么区别。我看到了不同的输出。
两者都从具有单个分支的克隆运行。

git whatchanged -m -- foo.c

git rev-list --reverse --all -- foo.c

最佳答案

git whatchanged man page 中所述:

Shows commit logs and diff output each commit introduces.
The command internally invokes git rev-list piped to git diff-tree, and takes command line options for both of these commands.

“传输到 git diff-tree”将解释两个命令之间的不同输出。

您可以在“In git, how can I get the diff between all the commits that occured between two dates?”中找到 git rev-listgit diff 结合的示例。


2013 年 9 月更新:

new version of the man page for git whatchanged now emphasizes :

New users are encouraged to use git log instead. The whatchanged command is essentially the same as git log but defaults to show the raw format diff output and to skip merges.

The command is kept primarily for historical reasons; fingers of many people who learned Git long before git log was invented by reading Linux kernel mailing list are trained to type it.

在“Difference between git-log and git-whatchanged?”中查看更多信息。

关于git - "git whatchanged -- filename"和 "git rev-list -- filename"有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8411686/

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