The Negro musicians used to play in the streets and get moved on or arrested as it was illegal. They then contrived to play on a small cart called a 'gig' which was easier to move and enabled a faster get away. Thus 'going on a gig' or doing a gig. This is my understanding of the term.