We like to forcefully hold onto people JUST BECAUSE we are not ready to give them to someone else. However, if a person does not have complete peace with you, the harsh reality is in accepting that you may actually have to eventually deal with their happiness being elsewhere. Truth is, no matter how incredible you are, maturity is in knowing you are not meant for everyone. At SOME point you're either breaking up or marrying each other; you cannot have both. You must always enter into a situation fully understanding this very thing so you can shield better against possible disappointment from whimsical expectations of living happily ever after with everyone you develop feelings towards. Otherwise, you'll be leading a SURE-FIRE way to get hurt, endlessly!
How do you accept giving your all to a man who just leaves you for someone else? You can never fully accept something like that. It is important though that you do not close yourself off with fear that you were unlovable. Needing a few improvements? Maybe. Lost pieces of your self-esteem? Perhaps. But someone leaving to be with someone else is a free-will decision. No matter how much power you feel you have in your arsenal to get him to stay, if he wants to leave, he will do so. If you give to a man and he let's you know upfront, with his actions, as definitely with his words, that you may care deeper about him than he does about you, you may have to accept that you could be grooming him for someone else.