Yes garlic can give you gas and cause bloating since the garlic contains Fructans which causes the bloating and gas.
Garlic is good to eat in moderation and I love garlic myself and would put it in every meal that I make but If I do eat too much garlic then I have bloating and severe gas which is never good to have when working among people.
I work in an office and would stink up the office with my gas from eating too much garlic. lol