How can I get a list of all the files that were changed in a branch? I can't do a git-diff because the branch is already merged into master.
I would need a way to list all the commits in a branch and extract the path of the files, without duplicates.
If anybody has done a thing like this before it will be really appreciated,
a lot of thanks!
Find what file changed in a commit To find out which files changed in a given commit, use the git log --raw command. It's the fastest and simplest way to get insight into which files a commit affects.
To get all the changes from all the branches, use git fetch --all . And if you'd like to clean up some of the branches that no longer exist in the remote repository, git fetch --all --prune will do the cleaning up!
To get a list of all branches from the remote, run this command: git pull.
If we consider your branch as BranchA wich was branched from master, you can do:
git diff --name-status `git merge-base BranchA master`..BranchA
This will give you the list of changed files in branch prefixed with status (M for modified, A for added, D for deleted).
This works if the branch is pointing to the merge commit:
git diff branch_name^..master --name-only
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With