Genesis 2:24 'Therefore doth a man leave his father and his mother, and hath cleaved unto his wife, and they have become one flesh.'
This is what happens when you have no clue of the context and you are trying to create passages that in no way deal with the issue you want it to deal with.
G-D is saying that "a man leave his father and his mother, and hath cleaved unto his wife" and they create a child together.
I don't get how you feel that has anything to do with the issue.
Josua 17:1-6 The daughters of Zelophehad inherited tribal rights and retained them by their cousins.
They said, 'Why should our father's name disappear from among our family? Allow his brothers to raise up sons on his behalf.'
This has to do with the laws of inheritance.
The link below has the passage straight form the Torah.
Numbers - Chapter 27 (Parshah Pinchas) - Tanakh Online - Torah - Bible
The daughters of Zelophehad's father died and there were no brothers. During the current law the inheritance would go to the uncle.
However, they appealed to Moses. Moses first said no, and then brought it before G-D. G-D overruled Moses.
This deals strictly with the laws of inheritance and is not about tribal lineage.
Genesis 38:8 'And Judah saith to Onan, 'Go in unto the wife of thy brother, and marry her, and raise up seed to thy brother;'
This is saying that if a wife's husband died, his brother is supposed to marry her.
Once again nothing to do with tribal lineage.
Below is how we know tribal lineage come solely from the father.
Numbers chapter 1
Numbers - Chapter 1 (Parshah Bamidbar) - Tanakh Online - Torah - Bible
( had some formatting issues)
Hide
Chapter 1
1. The Lord spoke to Moses in the Sinai Desert, in the Tent of Meeting on the first day of the second month, in the second year after the exodus from the land of Egypt,
:
2.
Take the sum of all the congregation of the children of Israel, by families following their fathers' houses; a head count of every male according to the number of their names.
:
3. From twenty years old and upwards, all who are fit to go out to the army in Israel, you shall count them by their legions you and Aaron.ג
4. With you there shall be a man from each tribe,
one who is head of his father's house.
:
16. These were the ones summoned by the congregation,
the princes of the tribes of their fathers; they are the heads of the thousands of Israel.
18. and they assembled all the congregation on the first day of the second month,
and they declared their pedigrees according to their families according to their fathers' houses; according to the number of names, a head count of every male from twenty years old and upward.יח
20.
This was [the sum of] the children of Reuben, the firstborn of Israel, their descendants according to their families, according to their fathers' houses; the number of individual names of every male from twenty years old and upward, all who were fit to go out to the army.
:
22.
Of the tribe of Simeon, their descendants according to their families, according to their fathers' houses; his tally, according to the number of individual names of every male from twenty years old and upward, all who were fit to go out to the army.
:
24.
Of the tribe of Gad, their descendants according to their families, according to their fathers' houses; the number of individual names of every male from twenty years old and upward, all who were fit to go out to the army.כד. לִבְנֵי גָד תּוֹלְדֹתָם לְמִשְׁפְּחֹתָם לְבֵית אֲבֹתָם בְּמִסְפַּר שֵׁמוֹת מִבֶּן עֶשְׂרִים שָׁנָה וָמַעְלָה כֹּל יֹצֵא צָבָא: