Oh, my stars and garters
A jocular exclamation or expression of astonishment.
'Oh, my stars and garters' is now very much an American expression. I haven't ever come across 'in the wild' here in the UK. That's a little odd as, as we shall see, the phrase's origins are very much English.
'Stars' has been a favourite in British exclamations for many centuries; for example, 'bless my stars', 'thank my lucky stars' - both 17th century coinages. This usage of the word dates back to at least the 16th century, when it was used by Christopher Marlowe in the play The troublesome raigne and lamentable death of Edward the second, circa 1593:
O my starres! Why do you lowre [bring down in rank] unkindly on a king?
The stars in question are the astrological bodies and one's stars were one's position in life, or disposition.
Moving on to 'garters' and the connection isn't with astrology, or even hosiery, but with chivalry. The Noble Order of the Garter is the highest heraldic order that the British monarch can bestow. Queen Elizabeth is seen here with the emblem of the order which is worn by the monarch when the members of the order assemble. The sharp-eyed amongst you will have noticed that the emblem is in the form of a star - like several other of the honours and decorations bestowed on British notables. 'Stars and garters' was used as a generic name for the trappings of high office and, by extension, the people who occupied such; for example, this piece from Alexander Pope's The Rape of the Lock, circa 1712:
While Peers, and Dukes, and all their sweeping train, And Garters, Stars, and Coronets appear.
'Oh, my stars and garters', when used as a humorous exclamation, appears to be a merging of the previous 'star' exclamations and the 'stars and garters' associated with the honours given to the great and the good.
The earliest example that I can find of it used in that figurative way comes from The London Magazine, Volume 34, 1765, in a comic verse titled 'A Journey to Oxford':
"Supper at such an hour!
My stars and garters! who would be,
To have such guests, a landlady"
Stars and garters are still linked with landladies, as that is the name of many public houses in the UK.