Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
This particular phrase comes from《诗经·秦风·无衣》
Who said that you have no clothes to wear,
I will share with you my robe.
The king has called upon us that,
we make ready with spears and Ge's (戈)，
we fight against our enemies.
子是对男性的敬称，here it means "you".
In your quote 与子同仇，it means
Similarly, we call 孔仲尼 as 孔子 to show respect. Also we have 庄子、墨子、孟子、老子……
Required, but never shown