How do i get a list of files changed in a pull request via the git command line tool?

Viewed 5428

I need a git command that will list all of the changed files in a pull request.

I only want the file path of the changed files, no extra info.

I've tried: git diff --name-only but that doesn't return anything for a PR.

2 Answers

You can use GitHub API. For example, https://api.github.com/repos/octocat/Hello-World/pulls/488/files

octocat is project owner, Hello-World is project name and 488 is pull request number. You can modify these values for your pull request. This request returns a JSON array of modified files and filename attribute gives you file path.

Related