Old English fore (prep.) "before, in front of;" (adv.) "before, previously," common Germanic (cf. Old High German fora, Old Frisian fara, German vor, Gothic faiura, Old Norse fyrr "for"); from PIE *pr-, from root *per- (1) "forward, through" (see per).
As a noun, from 1630s. The warning cry in golf is first recorded 1878, probably a contraction of before.