Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude a directory from GitLab's merge request diff

Tags:

diff

gitlab

is it possible to exclude a directory from displaying a diff of merge request in GitLab?

We started to version the bower_components folder (1 - to speed up app build, 2 - because bower has no .lock mechanism), but it makes trouble when doing code review - many changed files appear inside bower_components which makes the diff harder to read.

Thanks in advance

like image 731
amik Avatar asked Dec 13 '16 08:12

amik


1 Answers

Since gitlab 8.8, gitlab support the .gitattributes.

So if your project does not have .gitattributes add it,

and to exclude files for diff, append:

*.<whatever> -diff

and to exclude directories from a diff:

<mydir> -diff
like image 74
Danny Avatar answered Oct 19 '22 23:10

Danny