I have the following command:
git diff branch1..branch2 | grep '^diff'
...that will output files that contains differences between two branches. Sample output is like this:
diff --git a/path-to-file1/file1.php b/path-to-file1/file1.php
diff --git a/path-to-file2/file2.php b/path-to-file2/file2.php
diff --git a/path-to-file3/file3.php b/path-to-file3/file3.php
How do I amend this command to get only the file path? I want to filter out the "diff --git a/" and "b/path-to-file1/file1.php". So, I want the final output to look like this:
path-to-file1/file1.php
path-to-file2/file2.php
path-to-file3/file3.php
Assume both branches have the same directory structure. So take either the "a/" or "b/" paths.