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

Github supports this now with a .gitattributes file.

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

  2. 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

Leave a Comment

tech