A sort of marriage. A fair was at one time held in Dumfriesshire, at which a young man was allowed to pick out a female companion to live with him. They lived, together for twelve months, and if they both liked the arrangement were man and wife. This was called hand-fasting or hand-fastening.
This sort of contract was common among the Romans and Jews, and is not unusual in the East even now.
`Knowest thou not that rite, holy man?' said A venel ...;`then I will tell thee. We bordermen ... take our wives for a year and a day; that space gone by, each may choose another mate, or, at their pleasure, [they] may call the priest to marry them for life, and this we call handfasting.'
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894
More on Handfasting from Infoplease: