ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

25、Git使用技巧与`git rebase`命令详解

25、Git使用技巧与`git rebase`命令详解

Git使用技巧与git rebase命令详解

1. 在命令行使用git blame

当使用Git GUI程序运行git blame遇到问题时,可以采用命令行的方式。在命令行中输入以下命令:

git blame math.sh

执行该命令后,会得到类似下面的输出:

256d4027 (Rick Umali 2014-08-05 18:54:56 -0500 1) # Add a and b 2732d6a3 (Rick Umali 2014-08-02 16:54:56 -0500 2) a=1 3847b0be (Rick Umali 2014-08-02 17:54:56 -0500 3) b=1 256d4027 (Rick Umali 2014-08-05 18:54:56 -0500 4) let c=$a+$b 6f6af168 (Rick Umali 2014-08-06 05:54:56 -0500 5) printf "This is the answer: %d

由于源文件通常较长,可将git blame的输出保存到文件中,命令如下:

git --no-pager blame math.sh > math-annotate

这里的>

返回列表