Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Upon using the phrase "great minds think alike" in chat today, I was informed that it is really a shortened version of "Great minds think alike, small minds rarely differ" or "Great minds think alike, and fools seldom differ." (Source) This longer phrase would seem to suggest the original meaning was a bit different than the current usage.
However, doing some research, I found this website which traces it back to 1618 in the form of "Good wits doe jumpe" (jumpe having an archaic meaning of coincide) attributed to Dabridgcourt Belchier. Elsewhere, I found an unsourced claim that the thought originated with Confucius.
This is a humorous expression that is used when you found out someone else was thinking about the same thing as you were. If you say, "Great minds think alike," you say, jokingly, that you and someone else must be very intelligent or great because both of you thought of the same thing or agree on something.