What many dog owners overlook who keep their dog mostly on their own premises, is that they deny their dog part of the most FUN their dog would otherwise have - all the more if they also deny playing dog games on their own premises. The German Shepherd Dog even more than other breeds needs frequent dog-dog socialization (as well as frequent dog-people socialization) in order to stay sane and develop pleasing behavior.
Socializing with other dogs (and more generally with other animals) doesn't have to introduce any risks, and shouldn't really. It can be undertaken safely, in a controlled way, in known environments. And if your dog is dog-reactive (reacts aggressively towards other dogs), then that's no excuse but a requirement to progressively socialize your dog with other dogs. The bigger the problem, the more important to take action immediately!
While it may sometimes help if first both dogs are on-leash, I personally found that things develop much calmer when both dogs are off-leash. Few dogs receive the right Leash Training, and so they experience the leash as a restraint that agitates them even without another dog on the scene. That's a bad starting base to socialize with other dogs.
I always leave the leash away. But I don't let the dog socialize with any dog (and certainly not with strays). I first determine if the other dog is a good match given my dog's physical stature, and more so, given both dogs' state of arousal. If yes, I let them socialize. If not, we walk away. Because in terms of the dog having FUN, no socializing is better than bad socializing: a quarrel is no FUN for either of the dogs.
Conversely, in terms of developing the dog's behavior by accustoming the dog to other dogs (which is the primary purpose of socialization), obviously even bad socializing is better than no socializing: the dog learns from every experience, including a dog fight. Dogs learn best from observing other dogs' behavior. The dogs may clearly be having FUN, yet they're also learning how to behave to please the other dog. And learning this helps to avoid future dog fights.
Thus there really is nothing as helpful overall, as socializing with other dogs!
Note that every key point raised above you can find more comprehensively explained in other places on this website. The menu is your friend. Here, links have been omitted only to keep this decision tree straightforward.
PLEASE NOTE: Posting a fragment of your overall dog problem in the comments below is not going to help. Provide complete details if you really seek the right solution. Of course we have a page for that as well: Dog Problem Consultation.