A gotra is the lineage or clan assigned to a Hindu  at birth. In most cases, the system is patrilineal and the gotra  assigned is that of the person’s father. Other terms for it are vansh, vanshaj, bedagu, purvik, purvajan, pitru. An individual may decide to identify his lineage by a different gotra, or combination of gotras.
According to strict Hindu tradition, the term gotra is used only for the lineages of Brahmin, Kshatriya and Vaishya varnas. Brahminical gotra relates directly to the original seven or eight rishis of the Vedas. Later, the term gotra was expanded beyond Brahmin.
A gotra must be distinguished from a kul. A kul is a set of people following similar cultural rituals, often worshiping the same divinity (the Kuldev, god of the clan). Kul does not relate to lineage or caste. In fact, it is possible to change one’s kul, based on one’s faith or Ista-devatā.
It is common practice in preparation for Maher marriage to inquire about the kul-gotra (meaning clan lineage) of the bride and groom before approving the marriage. In almost all Hindu families, marriage within the same gotra is prohibited, since people with same gotra are considered to be siblings. But marriage within the kul is allowed and even preferred.

Origin of gotra

In Vedic Sanskrit, the word “gotra” originally meant “cow-pen.” Cows were at the time (before invention of currency) the most valuable possession of a family group, so with time, the term “gotra” began to refer to the family group who owned a particular pen of cows. The term was associated eventually with just the family group and its lineage.
Gotra is the Sanskrit term for a much older system of tribal clans. The Sanskrit term “Gotra” was initially used by the Vedic people  for the identification of the lineages. Generally, these lineages mean patrilineal descent from the sages or rishis in Brahmins, warriors and administrators in Kshatriyas and ancestral trademen in Vaisyas.
The lineage system, either patrilineal or matrilineal, was followed by the South Asian people. In present-day Hinduism, Gotra is applied to all the lineage systems.
The case of sage Vishwamitra is the example. Thus the gotra must have been of the lineage of the learning one chose rather than the lineage of one’s birth. Rama is stated to be the descendant of Ikshwaku, but the lineage was broken when Kalmashpada got his son through Niyoga of Vasishta with Kalmashapad’s wife Madayanthi, and not through a biological liaison. Yet Rama is said to be Ikshwaku’s descendant and not of Vasishta. Some claim of a continuous biological linkage with the moola purusha [or most significant personality] of the Gothra, where as it need not be the case. Some times, a Gotra is based on the Guru for the family or one of the ancestors.
Marriages within the gotra (“swagotra” marriages) are banned under the rule of exogamy in the traditional matrimonial system. People within the gotra are regarded as kin and marrying such a person would be thought of as incest.
A much more common characteristic of Maher Community is permission for marriage between cross-cousins (children of brother and sister). 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.