Green’s Dictionary of Slang

gib n.

[abbr. Gibraltar, orig. a convict settlement to which prisoners were transported up until 1875]

a prison.

[UK]Five Years’ Penal Servitude 221: I did a lagging of seven and was at the Gib. three out of it.
[UK]M. Davitt Leaves from a Prison Diary I 201: He has done a tenner in Gib for a burst in the city, and is sent back on his ticket.