Your religion is very important to you. You want to raise your child under that religion, just like you were raised by your parents.
The problem is that you and your spouse are getting divorced. Your spouse is not of the same religion -- and is not really very religious at all. He or she doesn't want the child raised under that religion.
You think that the court might get involved, but that feels unfair to you. Don't you have a right to raise the child the way you see fit? Aren't your religious rights protected under the First Amendment?
Those rights absolutely are protected. You can't be legally barred from practicing your religion, and you have a general right to raise your child the same way.
The main reason that the court will become involved is if your ex says that the child's welfare is in danger. That is to say, the child could face some sort of harm because of the religious upbringing. That could even be the basis for the divorce.
In that case, the court may have to determine if the risk is real and the child could be harmed by decisions that you make. After all, the child's best interests are the focus of custody cases. If your religious decisions are actively working against the child's best interests, it could be problematic.
In the vast majority of cases, the court doesn't limit your rights. Parents are advised to work together to create a parenting plan and they have the same freedom of religion they had before the divorce. Throughout this entire process, it's important for you to remember your rights and understand what protections and freedoms you and your child have.
Source: Findlaw, "Divorce: Child Custody and Religion," accessed July 21, 2017