The word "gotra" means "lineage" in the Sanskrit language. Among
those of the Brahmin caste, gotras are reckoned patrilineally. Each
gotra takes the name of a famous Rishi or sage who was the
patrilineal forebearer of that clan.
At the beginning, these gentes identified themselves by the
names of various sages (Angirasa, Atri, Gautam, Kashyapa, Bhrigu,
Vasistha, Kutsa,and Bharadwaja; the first seven of these are often
enumerated as Saptarishis , the seven primordial sages, created
along with the universe by Lord Brahma, the creator God of
hindus).
Sometimes the descent is clarified by giving the names of two
sages. For example, Mitraswamin Kaushikasya (descendant of
Mitraswamin in the line of Kaushika). Sometimes 'older' or 'latter'
is added to the name of the sage if two have the same name. For
example, my gotra is Bhoot Upamanyu (in the line of older
Upamanyu).
To mention the Gotra is essential in rituals and in marriage.
Same gotra marriage is not preferred. In some communities more than
one gotra is to be avoided for marriage.
Apart from lineage, gotra, which literally means an enclosure
where cows are tethered. So, same gotra will mean that the
forebears of those people tethered their cows in the same
enclosure. An adopted son or daughter will have the same gotra as
the father.