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.
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.
Pull Request is a GitHub feature and not a native Git command. However, if you have the source and target branch names, you can get the files changed using,
git diff --name-status firstbranch..yourBranchName
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.