Is there a way (from the command line) to list the names of all files changed in a PR in Git/GitHub? This would be used to find what tests need to be run in a Travis CI buil
In general, you can list the files changed between any two commits with git diff --name-only
:
How to list only the file names that changed between two commits?
The problem here seems to be determining the 'merge base'. If all branches originate with master, then you could do:
git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD master)
This will show you the changes between the point at which the FETCH_HEAD
was branched from master
to the current FETCH_HEAD
. I tested this locally, and the PR branches are cut from master
I believe it should work.