I finally told my girlfriend that I hate her cooking.
Oh wow, what did you say to her?
I told her it's too greasy for me
I don't think you should have done that. You should show gratitude that she went out of her way to cook for you, even if you don't really like it.
But if I didn't say anything then she would keep cooking food that I don't like.
That's true, but you should have found a more polite way to say it, not just flat out tell her that you don't like her food. If someone cooks for you then you should show your appreciation.