Nail your colours to the mast
To defiantly display one's opinions and beliefs. Also, to show one's intention to hold on to those beliefs until the end.
In 17th century nautical battles colours (flags) were struck (lowered) as a mark of submission. It was also the custom in naval warfare to direct one's cannon fire at the opponent's ship's mast, thus disabling it. If all of a ship's masts were broken the captain usually had no alternative but to surrender. If the captain decided to fight on this was marked by hoisting the colours on the remnants of the ship's rigging, i.e. by 'nailing his colours to the mast'.
It is correct to use the English spelling, rather the the US 'nail one's colors to the mast', as the phrase originated in England. It is generally agreed that the expression was coined in reference to the exploits of the crew of the Venerable, at the Battle of Camperdown, a naval engagement that was fought between English and Dutch ships as part of the French Revolutionary Wars, in 1797.
The English fleet was led by the Venerable, the flagship of Admiral Adam Duncan. The battle didn't initially go well for the English. The mainmast of Duncan's vessel was struck and the admiral's blue squadronal standard was brought down. This could have been interpreted by the rest of the fleet as meaning that Duncan had surrendered. Step forward, horny-handed son of the sea and subsequent national hero, Jack Crawford. Crawford climbed what was left of the mast with the standard and nailed it back where it was visible to the rest of the fleet. This act proved crucial in the battle and Duncan's forces were eventually victorious. Some historians believe that the victory at Camperdown proved to be the end of the dominance of the Dutch at sea and the beginning of the period in which 'Britannia ruled the waves'. Crawford returned home to Sunderland to a hero's welcome.
The stalwart reputation of English seamen soon became part of the national consciousness. An address to the House of Commons by the playwright Richard Sheridan was reported in The Edinburgh Advertiser in January 1801:
"I have no hesitation in saying that the Maritime Law is the charter of our existence, the banner under which we all should rally; it is the flag which, imitating the example of our gallant seamen, we should nail to the mast of the nation, and go down with the vessel rather than strike it!"
The first use of the precise expression 'nail your colours to the mast' that I have found is from the English newspaper The Hereford Journal, August 1807. This reported a naval engagement between British and American ships in which the US captain surrendered without a fight, much to the disgust of his military superiors:
"You [Commodore James Barron] ought to have nailed your colours to the mast, and have fought whilst a timber remained on your ship."
Whether or not Jack Crawford was the first to 'nail his colours to the mast' we can't be completely sure, but it does look highly likely. The phrase wasn't known before his exploit and was widely used soon afterwards. Despite his heroic status, Crawford died a pauper and a drunkard and was buried in an unmarked grave. The local community raised a fund to erect a gravestone and later a commemorative statue. If you do have any doubts about Jack's role in linguistic history, it might be wise not to mention it in Sunderland.
See also - 'Jack' phrases.
See also - join the colours.