I understand that you're scared and don't know what to do. But if you're planning on keeping this baby, you need to start thinking like a mother. If he's showing violence now towards you, he'll probably be violent towards your baby. As a mother, it's your responsibility to protect your child from harm whenever you're able. Unless he goes into anger management, he will probably
not get better. In fact, he'll probably get worse after the baby's born. Babies take a
lot of patience, and it doesn't sound like he'll be able to handle it without resorting to violence.
If he's hitting you, you need to leave. That's all there is to it. Just like you need to protect your baby, you also need to protect your baby's mother. That baby is relying on you to keep him/her safe and warm inside your body - protect your body with everything you have. You can contact your local women's shelter if you need a place temporarily. Contact your friends, his parents, anyone you know - and find out what your resources are. Babies require a lot, and you need to get the ball rolling as soon as possible.
Good luck.