美文网首页Git
Git query when one line of code

Git query when one line of code

作者: JaedenKil | 来源:发表于2020-12-02 15:01 被阅读0次

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

相关文章

网友评论

    本文标题:Git query when one line of code

    本文链接:https://www.haomeiwen.com/subject/rqxuwktx.html