MANKATO, Minn. — Everything about Mike Hastings, the coach of the Minnesota State Mankato men’s hockey team, the surprising No. 1 overall seed in the N.C.A.A. tournament, involves a story — like how his family acquired its dog, a 3-year-old golden retriever named Gracie.

Hastings bought the dog shortly after taking over the Mavericks in 2012, combining a reward for his son, Hudson, with consolation for forcing his wife and two children to move for the third time in five years. In his dusty, uncluttered office this week, Hastings pulled a family photo with Gracie from a bookcase near his desk.

“My son asked: ‘How many times have you moved? I’m tired of moving,’ ” Hastings said.

He suggested getting a dog, and that, he said, “shifted the whole thing.”

“I said, ‘If you get straight A’s next year, we can get a dog,’ ” Hastings recalled. “Didn’t think that would happen. So we got a dog.”