As far as I know, there should be no garbage created when you call GetComponent, because you’d just be calling a method of the GameObject class, not creating and destroying an object, which is what would create garbage.
However, performance would be affected, because whenever you call a method, you create overhead, and that’s what you want to avoid.
Therefore, when you call gameObject.GetComponent<ScriptA>() five times, instead of once and caching it, you’d be creating 5 times the overhead. Although this may, or may not be noticeable degradation in the performance of the game, it would be good practice to avoid these extra calls, especially when they would be made frequently, e.g. inside Update().