|
# 文件指责[](#文件指责 "Permalink")
|
|
# balme[](#balme "Permalink")
|
|
|
|
|
|
在 GitLab 2.5 中[引入](https://git.sphere.ly/staff/publicgitlab/commit/39c657930625ddc3ac8a921f01ffc83acadce68f)
|
|
[Git blame](https://git-scm.com/docs/git-blame)提供有关文件中每一行的更多信息,包括最后修改时间,作者和提交哈希。
|
|
|
|
|
|
[Git blame](https://git-scm.com/docs/git-blame)提供有关文件中每一行的更多信息,包括最后修改时间,作者和提交哈希.
|
|
您可以在项目中的每个文件中找到 **blame**按钮。
|
|
|
|
|
|
您可以在项目中的每个文件中找到" **责备"**按钮.
|
|
[![File blame button](/docs/img/file_blame_button_v12_6.png "Blame button")](/docs/img/file_blame_button_v12_6.png)
|
|
|
|
|
|
[![File blame button](img/1427a32ce32914c8100f7563817e3d64.png "Blame button")](img/file_blame_button_v12_6.png)
|
|
选择 **blame**按钮时,您会看到一个带有说明信息的文件页面:
|
|
|
|
|
|
选择" **责备"**按钮时,您会看到一个带有说明信息的屏幕:
|
|
[![Git blame output](/docs/img/file_blame_output_v12_6.png "Blame button output")](/docs/img/file_blame_output_v12_6.png)
|
|
|
|
|
|
[![Git blame output](img/4a7c845c8d7b28d90af5923b08fb1e1d.png "Blame button output")](img/file_blame_output_v12_6.png)
|
|
如果将鼠标悬停在中的提交上,您将看到该提交的确切日期和时间。
|
|
|
|
|
|
如果将鼠标悬停在 UI 中的提交上,您将看到该提交的确切日期和时间.
|
|
## 历史提交 Blame[](#blame-previous-commit "Permalink")
|
|
|
|
|
|
## Blame previous commit[](#blame-previous-commit "Permalink")
|
|
|
|
|
|
|
|
在 GitLab 12.7 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/19299) .
|
|
|
|
|
|
|
|
要查看特定行的早期修订,请**在此更改**之前单击" **查看责备",**直到找到您有兴趣查看的**更改**为止:
|
|
要查看特定行的早期修订,请**在此更改**之前单击" **查看责备",**直到找到您有兴趣查看的**更改**为止:
|
|
|
|
|
|
[![Blame previous commit](img/dc12d72310a7e06d2981fd6774b0903d.png "Blame previous commit")](img/file_blame_previous_commit_v12_7.png)
|
|
[![Blame previous commit](/docs/img/file_blame_previous_commit_v12_7.png "Blame previous commit")](/docs/img/file_blame_previous_commit_v12_7.png)
|
|
|
|
|
|
## Associated `git` command[](#associated-git-command "Permalink")
|
|
## 与 git 协作[](#associated-git-command "Permalink")
|
|
|
|
|
|
如果从命令行运行`git` ,则等效命令为`git blame <filename>` . 例如,如果你想找到`blame`有关信息`README.md`在本地目录中的文件,运行以下命令:
|
|
在`git`的命令行中,文件的`blame`则等效命令为`git blame <filename>`。例如,如果你想找到`README.md`在本地目录中的文件`blame`有关信息,可以运行以下命令:
|
|
|
|
|
|
```
|
|
```markdown
|
|
git blame README.md
|
|
git blame README.md
|
|
```
|
|
```
|
|
|
|
|
|
您将看到类似于以下内容的输出,其中包括 UTC 格式的提交时间:
|
|
您将看到类似于以下内容的输出,其中包括 UTC 格式的提交时间:
|
|
|
|
|
|
```
|
|
```markdown
|
|
62e2353a (Achilleas Pipinellis 2019-07-11 14:52:18 +0300 1) [![build status](https://gitlab.com/gitlab-org/gitlab-docs/badges/master/build.svg)](https://gitlab.com/gitlab-com/gitlab-docs/commits/master)
|
|
fb0fc7d6 (Someone 2019-11-07 22:21:22 +0100 1)
|
|
fb0fc7d6 (Achilleas Pipinellis 2016-11-07 22:21:22 +0100 2)
|
|
^764ca75 (Someone else 2019-10-05 23:40:24 -0600 2) # CODEChina Documentation
|
|
^764ca75 (Connor Shea 2016-10-05 23:40:24 -0600 3) # GitLab Documentation
|
|
^764ca75 (Someone else 2019-10-05 23:40:24 -0600 3)
|
|
^764ca75 (Connor Shea 2016-10-05 23:40:24 -0600 4)
|
|
0e62ed6d (Someone 2019-11-26 21:44:53 +0000 4) This project hosts the repository used to generate the CODEChina
|
|
0e62ed6d (Mike Jang 2019-11-26 21:44:53 +0000 5) This project hosts the repository used to generate the GitLab
|
|
0e62ed6d (Someone else 2019-11-26 21:44:53 +0000 5) documentation website
|
|
0e62ed6d (Mike Jang 2019-11-26 21:44:53 +0000 6) documentation website and deployed to https://docs.gitlab.com. It uses the
|
|
``` |
|
```
|
|
\ No newline at end of file |
|
|
|
|
|
## File blame through the API[](#file-blame-through-the-api "Permalink")
|
|
|
|
|
|
|
|
您也可以通过[Git 文件指责 REST API](../../../api/repository_files.html#get-file-blame-from-repository)来获取此信息. |
|
|
|
\ No newline at end of file |
|
|