The 27-year-old Nottingham-born right-back joins the Minstermen on a one-year deal, having made twenty-two League appearances for Oldham Athletic in EFL League One last season.
Son of former Chesterfield manager Nicky Law and brother of the professional footballer of the same name, Josh turned professional in July 2007 and joined Alfreton Town from parent club Chesterfield on loan.
The deal was made permanent and Law spent six successful years at the Impact Arena.
In 2014, he was signed by Scottish top-flight side Motherwell and, during his two-year spell, featured in a famous 6-1 aggregate victory over Glasgow Rangers in a promotion/relegation play-off as well as the Europa League.
In 2016, after sixty-three appearances, Law moved back to England to join Oldham.