rg foo -g '!bar/'
Without the /, a file named bar will also be excluded.
/
bar
To ignore multiple files/folders, use {}
{}
rg foo -g '!{.git,.svn,.hg}'
[[shell]]