Garlic is an awesome companion plant, it accumulates sulfur, a naturally occurring fungicide which will help in the garden with disease prevention. Garlic also is helpful in pest suppression, it discourages aphids, flea beetle, Japanese beetle, fungus gnats, codling moths, cabbage loopers, ants, snails and spider mites as well as vampires and members of the opposite sex. There is also some proof that it deters mammalian herbivores such as rabbits and deer.
Plants to Avoid Planting with Garlic
It can be advantageously intermingled with most other vegetables and herbs, exceptions are asparagus , beans, peas, legumes, parsley and sage the sulfur it produces is detrimental to their development. 
Strawberries are sometimes suggested as a companion plant for Garlic and at other times the recommendation is to avoid intercropping the two. Although it is true that garlic discourages Aphids, spider mites and many other insects and accumulates natural fungicide it is not an ideal companion palnt for Strawberries.
One personal experience of one gardener is hardly scientific proof positive for the record I will state that I tried it once and was disappointed in my Strawberry yield and the flavor also seemed to be adversely effected, perhaps by the sulfur of the garlic. I would advise against planting garlic and Strawberries together.
Garlic is not extremely difficult to grow, but does require some patience. After a long growing season garlic will produce a multitude of bulbs. It is generally planted in the fall, but it can also be planted in the early spring as soon as the ground can be worked. Planting in the fall leads to bigger and more flavorful bulbs when you harvest the following summer and allows more mature garlic plants and bulbs to saturate your garden with their protective properties. See: Growing Garlic
Plants that Garlic Benefits as a Companion Plant
Fruit Trees benefit from garlic planted near their base. As previously stated it not only acts as a natural fungicide but also helps deter common fruit tree pests such as the peach tree borer and related species. It’s usefulness in this realm builds up over time so subsequent plantings of Garlic near the trees is advisable. Borers are beetles that lay their eggs in the tree bark. Their larvae eat into young trees.
Plants that are Beneficial to Garlic
Garlic benefits nearly all plants, a few exceptions are listed above. Companion planting is not always a one way street, if Garlic is so helpful to others then Garlic should also derive a benefit from the companionship of some plants.
- Carrots will deter some insects that feed on garlic scapes.
- Chamomile improves the flavor of Gallic.
- Rue, which will deter maggots which sometimes infest garlic.
- Yarrow is believed to improve garlic’s overall growth.