In a patrilineal Hindu society (most common), the bride and groom both belong to their father's gotra. The children of the couple would have their father's gotra throughout his life.
Marriages within the gotra ('sagotra' marriages) are not permitted under the rule of exogamy in the traditional matrimonial system. The word 'sagotra' is union the words 'sa' + gotra, where 'sa' means the same or similar. It is common practice in preparation for Hindu marriage to inquire about the kula-gotra (meaning clan lineage) of the bride and groom before approving the marriage. People within the gotra are regarded as kin and marrying such a person would be thought of as incest. In almost all Hindu families, marriage within the same gotra is prohibited, since people with the same gotra are considered to be siblings or cousins. But marriage within the jaati is allowed and even preferred. In Jatt and Gujjar caste marriage within people from the same gotra as self, mother and grandmother are not practiced. Also, if two persons whose mothers are from the same gotra don't prefer to marry because they consider themselves maternal cousins because their mothers are siblings/cousins because of the same gotra.
For example, Jats and Rajputs have 3000 Gotras and Mudirajas of Andhra Pradesh & Tamil Nadu have 2600 Gotras. Gotra is always passed on from father to children among most Hindus. However, among Malayalis and Tulus it is passed on from mother to children.
The Kannada words 'sahodara' (brother) and 'sahodari' (sister) derive their roots from the Sanskrit word 'saha udara' (सहोदर) meaning co-uterine or born of the same womb. In communities where gotra membership passed from father to children, marriages were allowed between maternal uncle and niece, while such marriages were forbidden in matrilineal communities, like Nairs and Tuluvas, where gotra membership was passed down from the mother.
A much more common characteristic of South Indian, Hindu society is permission for marriage between cross-cousins (children of brother and sister) as they are of different gotras. Thus, a man is allowed to marry his maternal uncle's daughter or his paternal aunt's daughter but is not allowed to marry his father's brother's daughter. She would be considered a parallel cousin who is treated as a sister as she would be of the same gotra.
North Indian, Hindu society, not only follows the rules of gotra for marriages but also had many regulations that went beyond the basic definition of gotra and had a broader definition of incestuousness. Some communities in North India do not allow marriage with some other communities on the lines that both the communities are brotherhoods.
An acceptable social workaround for sagotra marriages is to perform a 'Dathu' (adoption) of the bride to a family of different gotra (usually dathu is given to the bride's maternal uncle who belongs to different gotra by the same rule) and let them perform the ' kanniyadhanam' ('kanniya' (girl) + 'dhanam' (to donate)).