Heroin user Conner Jenkinson walked into News and Booze in South Kirkby near Pontefract and threatened the female shop worker with a steak knife - telling her to open the till, Leeds Crown Court heard.
Prosecutor, Susan Evans said the woman picked up a stick and repeatedly hit Jenkinson with it before he grabbed hold of the till and left the shop during the robbery, which was caught on CCTV
Jenkinson then went to a nearby churchyard and changed his trousers and jacket before meeting up with his father Martin Jenkinson.
Miss Evans said the till was passed between them while the two men ran back to their house.
Police release images of man wanted in connection with serious assault at Wakefield pub
Video footage shows massive blaze in Ferrybridge
New coffee shop unveiled in old Genesis Barbers building in Ossett
Heartless thieves steal £600 watches from Wakefield Hospice charity shop
Angry revenge-porn boyfriend jailed for sending explicit photo of his ex
Police arrested both men the following day and recovered the till, which was empty.
Miss Evans said the shop worker said in a victim impact statement: "It scared me to think what would have happened if he had stabbed me. This is causing nightmares."
Conner Jenkinson, aged 23, of Park Estate, South Kirkby, admitted, robbery and having a knife.
Martin Jenkinson, aged 51, also of Park Estate, South Kirkby, admitted handling stolen goods.
Kara Frith, for Conner Jenkinson, said: "Although he was frustrated about not getting into the till and although he is being hit repeatedly with a stick, he doesn't offer any further threats or violence."
Miss Frith said Conner Jenkinson has used heroin for a number of years, adding: "On the day of the robbery he said his motivation was money for drugs.
"He has had a tough time in prison, has had problems fitting in and has been bullied throughout his time in custody."
The court heard Conner Jenkinson, who suffers from drug-induced psychosis, has one previous conviction for criminal damage.
Martin Jenkinson has 27 previous convictions for 93 offences, the latest dating back to 2005.
Taryn Turner, for Martin Jenkinson, said he has been a heroin user, adding; He didn't know his son was carrying a steak knife and he didn't know he was going to steal the till."
Jailing Conner Jenkinson for two-years-and-eight-months, judge Simon Phillips QC told him: "You used a knife to commit the robbery.
"A single female was working in the store. She valiantly fought to get you to leave."
Woman stabbed 15 times in savage murder at Leeds flat after refusing to have sex with killer
Handing Martin Jenkinson an eight month prison sentence, suspended for two years, judge Phillips told him: "You posed a dreadful example to your son when you chose to help him when he chose to run off from the robbery with the till he stole from the shop."