Pete Seeger and Lee Hays were founding members of People's Songs, a music publishing company that specialized in tunes that supported various left wing causes including Communism. At its first board of directors meeting, Seeger and Hays staved off boredom by passing a sheet of paper back and forth, collaborating on the lyrics that became "If I Had A Hammer". Seeger and Hays recorded "If I Had A Hammer" with their new group, The Weavers (which included Ronnie Gilbert and Fred Hellermen) as their first release in March 1950. Lee Hays said "It was a collector's item. Nobody but collectors ever bought it."
In 1962 the melody was rewritten by Peter, Paul & Mary. Most people now sing it as they heard it on their record, not as Seeger and Hays sang it. This Peter, Paul & Mary version reached #10 on the Billboard chart in October 1962.
This was THE song that all the PP&M wannabes sang all through the 60's. When the New Dimension String Band played traditional material with fiddle and banjo, we'd hear people ask for "folk music", meaning mainly Peter, Paul & Mary's songs. I include it here purely for historical interest. I don't think I have sung it since, maybe, 1964.