PIE base ‘to gather’.
Other derivatives include gregarious, aggregate, egregious, congregate, and segregate, from Latin grex (stem greg-) ‘herd, flock’, and allegory and agoraphobia, from Greek ageirein ‘to assemble’, and cram, from Old English crammian ‘to stuff’.
[Pokorny *ger-1, gere-, pp. 382–383, ‘to cram, collect, put together’.]