Why is poop green sometimes?

Probably depends on what you ate! If you ate broccoli or asparagus or mainly just veggies turns your poops green