Hegarty has put pen to paper on a two-year deal with the Belfast club he made his Gers debut against in a friendly two years ago.
The 21-year-old will be a full-time player at Windsor Park and will help the Blues try to win back the NIFL Premiership next season.
Former Dundee United and Northern Ireland striker Warren Feeney has just succeeded long-serving David Jeffrey as Linfield boss.
And Feeney has assured his countryman he will get a regular game in his side in his preferred position at centre half in the 2014/15 campaign.
The versatile defender is keen to play first team football after being dogged by injuries in the last 12 months and hardly featuring for Ally McCoist’s team.
The Dungannon-born player, who played over 20 games for the Gers in the Third Division in the 2012/13 campaign, had his contract cancelled yesterday.
Speaking to the official Rangers website, Hegarty said: “I had a bad time with injury last season.
“At this important stage of my career I need to play first-team football week in week out and the manager was good enough to let me go and pursue that.
“I’d like to thank physio Steve Walker and Doc Jackson for all their work getting me back to full strength.
“I would also like to thank the gaffer and his team and the loyal Rangers supporters who as players we are honoured to represent.
“I wish the team all the best. I look forward to returning to Ibrox as a fan.”