Sorry if this sounds easy but I seem to be struggling with some of the more advanced GIT commands.
I am basically trying to find modified line numbers in files that have not been committed yet. Just staged. Im able to get the file names using:
git diff --cached --name-only --diff-filter=ACMR HEAD
Assuming I have an array of file names:
$changedFilesList = [0 => 'file1.php', 1 => 'file2.php'];
However what I am also interested in getting are the actual line numbers within those files where code was modified. Basically do a diff with the current checked out branch and wherever there are differences, get the line numbers also.
Any tips ?
UPDATE: I have looked at others solutions on stack overflow but they are heavy on bash scripting side. I am looking for a GIT specific or PHP solution.