Git query when one line of code
2020-12-02 本文已影响0人
JaedenKil
For instance, I want to check when the following line of code is added(Located in file NetflixTest.java):
mDevice.executeShellCommand("am force-stop com.netflix.ninja");
Step 1: Run git command:
git blame xxx/NetflixTest.java
Result
4c26a237 app/src/androidTest/java/com/xxx/NetflixTest.java (xxx xxx-03-03 15:32:01 +0800 16) mDevice.executeShellCommand("am force-stop com.netflix.ninja");
Step 2: Get more info about this commit:
git log 4c26a237 -1
Output:
$ git log 4c26a237 -1
commit 4c26a237606629bf6a7675aba457b59e72fdef2d
Author: xxx <xxx@xxx.com>
Date: Fri Mar 3 15:32:01 xxx +0800
Project Init