Ignoring specific files, file types or folders in a pull request diff

git, github, pull-request

Solution

Github supports this now with a `.gitattributes` file.

Create a `.gitattributes` file in the root of the repository.

Use the linguist-generated attribute to mark or unmark paths that you would like to be ignored for the repository's language statistics and hidden by default in diffs.

For example, to mark search/index.json as a generated file, add this line to `.gitattributes`:

search/index.json linguist-generated=true

Reference: https://help.github.com/en/github/administering-a-repository/customizing-how-changed-files-appear-on-github

Problem

We frequently use the Files Changed tab on a pull request to peer review the work we have done on a branch, unfortunately a major part of our development process is regenerating Flex services so when viewing the files changed 99% of the changes are irrelevant. This makes it very easy to miss important changes that should be reviewed. We know the folder that these regenerated services live in, and we could commit all the regen changes in one commit if that would help. Does anyone have any suggestions how we can improve this? Ideally we would exclude a folder from the pull request diff.

Original source

Related problems