git责怪什么? [英] What does git blame do?

查看:86
本文介绍了git责怪什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到很多关于使用 git blame 的方法的问题,但我不太了解它们。

I see a lot of questions about methods of using git blame but I don't really understand them.

我在github界面上看到一个 blame 按钮。点击它后,它会在左侧栏上显示一些带有用户名的差异。这是什么意思?

I see a blame button on top of files on the github interface. Upon clicking it, It shows some diff with usernames on the left bar. What does that indicate?

为什么git blame实际上用了,除了GitHub?

Why is git blame actually used, apart from GitHub?

推荐答案

从git-scm http://git-scm.com/docs/git-blame

From git-scm http://git-scm.com/docs/git-blame


使用最后一次修改行的修订版中的信息为给定文件中的每一行注释。

Annotates each line in the given file with information from the revision which last modified the line. Optionally, start annotating from the given revision.

当指定一次或多次时,-L将注释限制为所需的行。

When specified one or more times, -L restricts annotation to the requested lines.

示例:

Example:

johndoe@server.com:~# git blame .htaccess
...
^e1fb2d7 (John Doe 2015-07-03 06:30:25 -0300  4) allow from all
^72fgsdl (Arthur King 2015-07-03 06:34:12 -0300  5)
^e1fb2d7 (John Doe 2015-07-03 06:30:25 -0300  6) <IfModule mod_rewrite.c>
^72fgsdl (Arthur King 2015-07-03 06:34:12 -0300  7)     RewriteEngine On
...

请注意, git blame 不会按时间顺序显示每行修改历史记录。
它只显示最后一个人在文档中改变了一行,直到最后一次提交 HEAD

Please note that git blame does not show the per-line modifications history in the chronological sense. It only show who was the last person to have changed a line in a document up to the last commit in HEAD.

也就是说,要查看文档行的完整历史记录,您需要运行 git blame path / to / file 为您的 git log 中的每个提交。

That is to say that in order to see the full history/log of a document line, you would need to run a git blame path/to/file for each commit in your git log.

这篇关于git责怪什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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