use git blame
to achieve
see if it works
NAME
git-blame - Show what revision and author last modified each line of a file
SYNOPSIS
git blame [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental] [-L n,m]
[-S ] [-M] [-C] [-C] [-C] [--since=] [--abbrev=]
[ | --contents | --reverse ] [--]
DESCRIPTION
Annotates each line in the given file with information from the revision which last modified the line. Optionally, start annotating from the given revision.