I need to know the changed line numbers between two commits (HEAD~1 and HEAD
) to a repo
git diff HEAD~1 HEAD
returns information in a confusing diff format
I was able to identify newly added files or deleted files by looking at their markers in git diff (ie --- /dev/null
and +++/dev/null
meaning added, deleted)
Is it possible to identify the lines numbers in the modified files
The need for me is
path/to/file/MyClass1.java
23-56
59-60
72-74
path/to/file/MyClass2.java
1-34
54-56
23-56 , 72-74 and 59-60 are the line/range of lines (denoted as line number) changed between HEAD~1 and HEAD
PS: few of the leads which I found on other SO questions seems to be outdated Any help will be deeply appreciated!