Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 795
gurpsone Avatar asked Mar 05 '23 17:03

gurpsone


1 Answers

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

Showing which files have changed between two revisions

like image 82
hsirah Avatar answered Apr 24 '23 11:04

hsirah