There's a few other words with "gm", like "gmerać" (to fiddle with sth), "gmin" (plebs, common people - same root word as gmina I'd imagine), "gmach" (a huge building, usually of some public institution).
It's not a digraph tho, it's just pronounced as "g" and then "m"?
I'm like 99% sure it's a German loanword. Most of city/administration/building language in Polish comes from German - dach (roof), szyba (glass pane), rynek (main market square), ratusz (city hall), burmistrz (city mayor), rynsztok (gutter), etc.
All through middle ages Poland imported lots of germanic settlers and had them build whole new towns from scratch in Poland in exchange for tax breaks. There's a town called "Niemcy" (Germans/Mutes) like 10 km from where I live :), and there's a village called "Dys" nearby.
What's the problem with using latin script for gm by the way?
English has entered the chat