The song is derived from an American Civil War song, "When Johnny Comes Marching Home", written by Irish-born Massachusetts Unionist Patrick Sarsfield Gilmore, which is in turn derived from the Irish anti-war song "Johnny I Hardly Knew Ye". The American Civil War song was popular with both sides of the conflict.
Having learnt the song at school, Joe Strummer suggested the band update it. Those on the left saw the rise during the mid-1970s of far right groups such as the British National Front as alarming and dangerous omens for Britain's future. The song is about this state of politics in Britain and warns against all things uniformed and sinister - shortly after the song was first performed live at Rock Against Racism Joe Strummer said in an interview to the music newspaper Record Mirror:
The lyrics to The Clash's version vary greatly from the original.