Camaraderie
Etymology
From French camaraderie, from camarade "comrade," from Spanish camarada "roommate, barrack-companion," from cámara "chamber," from Latin camera "vaulted room." The bond was originally that of soldiers who literally shared a room.
noun · /kah-muh-RAH-duh-ree/
The warm loyalty and good humor among people bonded by shared effort or hardship.
What it names
A handle for the specific closeness that comes from being in something together — a team, a unit, a shift — rather than from private affection.
Example
She missed the pay less than the camaraderie of the night shift, the jokes that only made sense at 3 a.m.
Related idea
Distinct from friendship: camaraderie is group warmth generated by common circumstance and can evaporate when the shared task ends, whereas friendship is a chosen bond between individuals that outlasts the situation that sparked it.