1862, "hut, shed, shelter," popularized among soldiers in the U.S. Civil War, but like other Civil War slang (such as skedaddle) of uncertain origin. Perhaps an alteration of shebeen (q.v.), but shebang in the sense "tavern," a seemingly necessary transitional sense, is not attested before 1878 and shebeen seems to have been not much used in the U.S. Bartlett's 1877 edition describes it as "A strange word that had its origin during the late civil war. It is applied alike to a room, a shop, or a hut, a tent, a cabin; an engine house." Phrase the whole shebang first recorded 1869, but relation to the earlier use of the word is obscure. Either or both senses also might be mangled pronunciations of French char-à-banc, a bus-like wagon with many seats. For an older guess:
[Shebang] used even yet by students of Yale College and elsewhere to designate their rooms, or a theatrical or other performance in a public hall, has its origin probably in a corruption of the French cabane, a hut, familiar to the troops that came from Louisiana, and constantly used in the Confederate camp for the simple huts, which they built with such alacrity and skill for their winter quarters. The constant intercourse between the outposts soon made the term familiar to the Federal army also. ["Americanisms: The English of the New World," Maximillian Schele De Vere, New York, Charles Scribner & Co., 1872.]