The answer to this is do not ask the girl out if she has a boyfriend. First of all, you will be breaking the bro code. I don't know if you're familiar with this but if not, I recommend you watch How I Met Your Mother. Second, this is a selfish thing to do. If you know that the girl is in a relationship and is happy about it, don't try to ruin what she already has with her boyfriend just because you want to be with her. Third, there are so many fish in the sea. However, if she is the particular fish that you really like/want/love (whatever it is that you think you feel), you could just wait it out. That is, if you're patient enough to wait for a girl. Do not ask her out while in a relationship. Wait for her to be single. And then try your luck.