查看某行代码的git修改历史

使用: ~/gitEditHis.sh file code



1
2
3
4
5
6
7
8
9
 #!/bin/bash
version=`git log $1 |grep commit |awk '{print $2}' `
for i in $version;
do
echo $i ;
git checkout $i;
git blame $1 |grep $2;
done
git checkout master


Category web