I was told, years ago, that the black americans were not allowed to perform their music jaz/blues in public for fear of arrest and prison. The answer to this was to perform on the back of a cart (gig) in the streets. They could then move swiftly if the authorities came along and perform somewhere else. Hence the term doing a 'gig'