我想知道我在哪个提交中添加了下面给出的代码:
if (getListView().getChildCount() == 0)
getActivity().findViewById(android.R.id.empty).setVisibility(View.VISIBLE);
我该如何实现这一点?
发布于 2013-11-09 18:56:48
对该文件运行git blame
。它将显示每一行的提交ID、日期和时间以及提交者。然后只需复制出提交标识符,您就可以在git log <commit>
或git show <commit>
中使用它。
例如,我有一个名为test.txt的文件,在不同的提交中添加了行:
$ cat test.txt
First line.
Second line.
运行git blame
$ git blame test.txt
^410c3dd (Leigh 2013-11-09 12:00:00 1) First line.
2365eb7d (Leigh 2013-11-09 12:00:10 2) Second line.
第一位是提交ID,然后是名称,然后是日期、时间、时区,最后是行号和行内容。
发布于 2017-07-01 18:49:48
git log -S searchTerm
为您提供引入搜索词的提交。
发布于 2013-11-09 22:01:34
有一种方法比对整个文件发出责备更快。如果行为${lineno}
,文件为${filename}
,则可以:
git blame -L ${lineno},${lineno} ${filename}
示例:
git blame -L 2,2 test.txt
https://stackoverflow.com/questions/19875104
复制相似问题