Well, in my experience factions and/or divisions in cohorts can happen (of course some more severe than others). So, the best route that I found was to just focus on work and avoid conversations of little to no value (i.e., just gossip or hearsay about other members in the program). It is really tiresome and I have found that as one progresses through the program you really just lose the appetite for it.
Similarly, in the beginning of graduate school, I used to be super worried about what the professors thought about me both personally and work wise. However, as time went on and I gained more experience, self-confidence, as well as viewing the faculty as people (with their flaws) rather than gods I also noticed that I worried less about what they thought (of course, in so far as you are not doing anything egregious) and just, again, focused on gaining competency and excelling in work. Let those things speak for themselves.
In some ways, I think almost naturally, you then tend to gravitate towards those faculty members and fellow students with similar interests and whom you could collaborate with in the future.
Ultimately, just be you, and worry less about what others are gossiping about.