Find commit that first added a particular line of code on Github
First, you have to clone the repository to your machine:
git clone https://github.com/BVLC/caffe.git
Simply use git-blame
to find out who committed a certain line:
git blame -L 123,123 path/to/file.cpp
Or, for a range of lines, use -L 100,150
or similar. You may want the option -M
which detects if lines were moved.
You can also use git-log
for the entire commit log:
git log -L 123,123:path/to/file.cpp