Fairly common saying today, indicating an order to someone to stay in place and defend/guard something.
According to the Civil War trivia desktop calendar on my work-mate's desk, this saying began in October of 1864.
The Union's General Sherman signaled a besieged Union position at Allatoona, Georgia with a message that said "Hold fast. We are coming." Apparently this was mis-translated as "Hold the fort. We are coming."
The rest, as they say, is history.