Where did the idiom "giving a heads up" come from?

I know giving heads up means to inform someone, but how does that relate to the literal meaning i.e. giving heads up? What's the background? Where did it come from?


Solution 1:

It was first used as an interjection in the 19th century: “They marched, and I amongst them, to face the enemy – heads up – step firm – thus it was – quick time – march!”

Then, at the beginning of the 20th century, it began to be used adjectivally, as in: “He was always right on the job, and looking ‘heads up’.”

Then, around the late 70s, it became a noun, probably through shortening of phrases like “heads-up alert” into “heads-up”: “It is regarded as being a heads-up on a sale.”


Source and references: the Grammarphobia blog

Solution 2:

Imagine your buddy is next to you and he is reading a book, or looking at something in his hands, or in some other way looking anywhere other than straight ahead. You see trouble coming and you say "heads up!" meaning hey, attention, look ahead! That is the literal meaning of giving someone a heads-up. Over time it's gained a metaphorical one that applies to emails telling someone what's going on, phone calls, and so on.