How to find out in which commit a particular code was added?

前端 未结 5 716
执念已碎
执念已碎 2020-12-22 22:13

I want to find out in which commit did I add the code given below:

if (getListView().getChildCount() == 0)
                getActivity().findViewById(androi         


        
5条回答
  •  情深已故
    2020-12-22 22:57

    If code is being maintained in Git repository and intellij IDE along with Git plugin is being used to browse the code then i have found the following way very intuitive:

    1. Open the file in intellij
    2. Go to context menu -> Git -> Annotate.
    3. New window will appear where each line in new window tells who made that line commit.

    Following screenshots are for the references:

提交回复
热议问题