Hit him? That's just barbaric, and animal abuse. I'd beat the crap out of the husband out before I'd hit the dog. That's definitely the wrong action to take. There's not a dog expert in the world worth their salt that would advocate beating an animal. I have a 5 year old GSD and they are extremely loving and affectionate dogs and there's absolutely nothing wrong with that. My GSD is a rescue with an unknown history but he's just like the 3rd child in the family. Biggest issue with him is he likes to hog the bed. :-) My Shepherd shadows me constantly. I wouldn't have it any other way nor would my husband because he likes that there is someone here to keep the family safe when he's not home.
All dogs see their people as their pack leaders. The pack leaders are cherished and loved by those lower in the pecking order and you are very important to him. Before resorting to abuse, did your husband consider that the dog might be wanting to protect both you and the child? Following you and the baby around so closely may be his way of making sure you and the baby don't get into any danger and that if you do, he will be there to help you. If the dog was properly raised and socialized as a pup, you shouldn't have anything to worry about. Shepherds can be willful dogs but a firm "NO!" establishes that he has done something you do not like. The pack leader needs to chastise the follower. Not with a beating but with a firm word. Let the sound of your voice let him know you mean business. A strong and sharp "NO!" from you, his human back leader, equals the growl or serious bark he would receive from his canine pack leader in the wild. He will still respect you for it later.
Introduce the dog to the baby. The only thing you need to keep a close eye on is that if the baby is playing with the dog, do NOT let the child pull the dogs tail or ears or hurt the dogs nose. Teach the baby to respect the dog as much as the dog respects the baby. Both of my children were raised around VERY large dogs (100-250+ lbs) from the moment they were born and I've never had a single problem with the kids and dogs. Sure, one of the kids might have gotten knocked on their bottom while playing with the dog but it was nothing done intentionally. No harm, no foul.
Please, please, please don't hit that dog. Beating him isn't the way to stop a behavior you don't like. GSD's are highly intelligent and he can learn extremely fast what you do and do not want him to do without laying a hand on him.