Use git blame
– a little feature in git that allows you to see who wrote what in the repository. If you want to know who changed certain lines, you can use the -L flag to figure out who changed those lines. You can use the command:
git blame -L <line-number>,<ending-linenumber> <filename>