Home · RSS · E-Mail · GitHub · GitLab · Twitter

Quick Tip: Hiding changes of specific folders in GitLab merge requests

When you store third-party dependencies (such as a vendor folder for Go, node_modules for npm, or venv for Python) in your repositories and don’t want changes in the dependencies to show up in your merge requests, you can collapse all diffs for specific folders.

All you have to do is creating a .gitattributes file with the following content:

1
vendor/* -diff

Just replace vendor with the folder which contains the changes you want to ignore. This is only applied when the .gitattributes file is already merged in your default branch (e.g. master). Otherwise, it will still show the diffs in all merge requests!

The disadvantage of this approach is, that it’s not possible to expand the changes manually again, if you want to have a peek inside the changes for once.

Collapsed Changes


Home · RSS · E-Mail · GitHub · GitLab · Twitter