Gary Locke first took over as caretaker manager when previous incumbent Allan 'Magic' Johnston left in February 2015. The former Hearts manager had been working as Magic's assistant and, with the transfer window just closed, was left to work with a squad which had suffered the deadline day loss of Robbie Muirhead to Dundee United.
After a string of poor results including a 5-1 thrashing away to Dundee United and a disappointing performance in his final game at home to Hamilton, Locke resigned on 30th January 2016.
From his Wikipedia: After retiring as a player, Locke was in line to join the Kilmarnock coaching staff, but the collapse of Setanta led to reduced TV income for SPL clubs and Kilmarnock decided they could not offer Locke a position.
After Jim Jefferies was appointed Hearts manager for the second time in January 2010, Locke was appointed First Team Coach. He was placed in caretaker charge of the team after the departure of John McGlynn in February 2013. He was subsequently appointed on a permanent basis, on a contract until the end of the 2013–14 season.
In March 2013 Locke's Hearts lost 3–2 to St Mirren in the Scottish League Cup Final. Hearts entered administration in June 2013, which meant that the club were placed under a transfer embargo and were deducted 15 points in the 2013–14 Scottish Premiership season. On 11 August 2013, Locke won the first Edinburgh derby in the new Scottish Premiership with a 76-minute header from striker Callum Paterson at Tynecastle Stadium.
Hearts were relegated to the Scottish Championship at the end of the season and new owner Ann Budge decided not to retain Locke.
In June 2014, Locke returned to Kilmarnock as assistant manager. He was put in caretaker charge of the team after Allan Johnston left Kilmarnock in February 2015. Locke was then appointed on a permanent basis in April 2015.