The Root of the Behavior
It is common in any and all dogs that are loyal and protective, so there is no need to single out German Shepherds in this capacity. Secondly, your dog may have hair raise on his back because he is excited. Just as aggression provokes an emotional response in your dog, so does excitement. If your dog is happy to see you or if he is around other animals, he may have hair lift on his back. With that excitement, your dog may also have anxiety. If Danny meets a new friend, he may have hair raise on his back during the first minute or two because he is anxious about this new dog. But once he feels comfortable, the hair might fall back down. It is a completely normal response in your Danny. The amount of hair that stands up on your dog's back does not matter, so do not worry if more hair stands up during times of anger over times of anxiety.
Encouraging the Behavior
German Shepherds are more prone to this reaction than other dogs because of how they are. In fact, you may see German Shepherds working with law enforcement and they are used for protection. Therefore, it is more likely that Danny may have hair raise on his back when he is in a defensive mode rather than a happy mode. You can also watch the hair on your dog's back for the location of where it raises. Most times, you will notice that the hair will raise on your dog's shoulders when they are angry over having hair raise along their whole back.