Green is germ, so you can eat it.
If you cut the garlic cloves and find that the middle inside is green, this little green dot is actually the germ of garlic, which means that garlic has sprouted, which is edible in kind of garlic and there will be no problem. The garlic seedlings we usually eat grow from this little green dot.
Green is green because of oxidation, and you can eat it.
If the minced garlic turns green, it is because allicin in garlic will undergo an oxidation reaction with oxygen in the air. As a result of this reaction, garlic will turn from milky white to light green, and it can also be eaten, just like potatoes will oxidize and turn black in the air for a long time. At this time, as long as they are soaked in water for a while, the color will fade and they can continue to eat. However, garlic powder does not need to be soaked in water, and can be eaten directly.
Green is caused by environmental changes, so you should not eat it.
This situation means that garlic stored in the sun will germinate, and the surface will turn green when it germinates. This green is an alkaloid, so it is best not to eat garlic in this case. Some people may ask, germinated garlic can still be eaten, why is it said here that it cannot be eaten? We say that germinated garlic is edible because this kind of garlic is stored indoors in a cool and ventilated place, so germinated garlic can be eaten. However, when garlic is placed in the sun and germinated under the irradiation of the sun, alkaloids will be produced on the surface of garlic, which is harmful to human body, so it is recommended that you do not eat it.