git log< filename>不显示提交,但git日志显示编辑文件的提交 [英] git log <filename> doesn't show commit, but git log shows commit that edited the file

查看:395
本文介绍了git log< filename>不显示提交,但git日志显示编辑文件的提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我输入:

  git log httpd.conf 

我得到一堆提交哈希如预期的那样,但不是我所做的。



当我输入时:

  git log 

我看到了我所做的提交。当我运行时:

  git show< hash> 

我看到了我对httpd.conf的编辑



<任何人都可以解释可能发生了什么?如果有更多需要发现根的信息,请告诉我。 从git文档( http://git-scm.com/docs/git-log ):

默认模式 - 将历史简化为解释树的最终状态的最简单历史记录。最简单的,因为如果最终结果是相同的(即合并具有相同内容的分支)它会修剪一些分支。



尝试使用:


git log --full-history

(与默认模式相同,但不修剪一些历史。)


I discovered this odd issue while looking for a lost change.

I typed in:

git log httpd.conf

I am getting a bunch of commit hashes as expected, but not the one I did.

When I type in:

git log

I see the commit I made. When I run:

git show <hash>

I see my edits to httpd.conf

Can anyone explain what may have happened? If there is more information needed to discover the root please let me know.

解决方案

From git docs (http://git-scm.com/docs/git-log):

Default mode - simplifies the history to the simplest history explaining the final state of the tree. Simplest because it prunes some side branches if the end result is the same (i.e. merging branches with the same content)

Try using:

git log --full-history

(Same as the default mode, but does not prune some history.)

这篇关于git log&lt; filename&gt;不显示提交,但git日志显示编辑文件的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆