SriRamchandra was Vashistha Gotra , All castes have gotra but incidentallly all of them have gotra of bramhin rishis only.why?
certainly these were not born to them ,what is Gotra?
In Tretayuga Bramhins are in majority in the world,InDwapara Kshatriyas are in Majority,both these reduce to minority in Kaliyuga.As Bramhins are born in a lineage they acquire the gotra of that lineage. offsprings of Vashistha etc will have Vashistha etc gotra. Similarly these rishis have a sishya varga [as they had a gurukul of their own ] all these Kshatriya moola kula had the gotra of the rishi they belonged to as pupils.Kings had or the gotra of the Purohit they were consulting. Similarly Vaishyas followed suit. Shudras being in minority served the community They engaged in selling utensils ,colours,pots etc.whichever university campus they belonged to they acquired the gotra of the kulapati.
Thus everyone has gotra and lineage to identify with.People of similar gotra do not marry unless there is difference of 10 heads[genearation ] between them .
Note: Infact technically we cannot attribute a Gotra to God as he is neither born not acquires a body .[the word is Pradurbhava]manifestation is what we can describe the appearance of God on earth. Just as humans grow from baby to an adult,it will be folly to assume that God grows from a baby to full grown adult. God has many roopas and he has roopas appropriate to every age,he manifests them as time surpasses giving illusion of growth to the onlookers. His intelligence and strength and other qualities also remain same full and complete in all phases .There is no caste or creed or gotra for Lord ,all these are distinctions of jeeva to indicate its apoornatva .
Still Vashishtha is considered very auspicious Gotra because Shri VedVyasa and all sooryavanshi greats belonged to it.Its the beacon light of Dharma.