版本控制:Git 命令与 Rebase 实战
1. 使用命令行运行 git blame
在使用 Git 时,可能会遇到 Git GUI 程序运行git blame出现问题的情况,此时可以使用命令行机制。以下是具体操作步骤:
1. 在命令行中输入以下命令运行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 &