There is no city in the world quite like San Francisco. Despite a rising gap between rich and poor, sky-high rents, rapidly increasing property values and a homelessness crisis, the city remains one of the most progressive and dynamic in America.

It wasn’t always like that. For much of the 20th century, San Francisco was a lot like many other American cities. It had some radical history, most notably the general strike of 1934, but by mid-century, it was governed by socially conservative pro-business politicians from both parties. Like most major American cities, it was heavily Catholic and majority white.

San Francisco’s profile had begun to change by the mid-1960s, as the city’s tolerant climate attracted young people including hippies, flower children and, a few years later, gay and lesbian residents in greater numbers. Racial minorities, long excluded from San Francisco’s power structures, had begun to demand a voice as well. During the late 1960s into the 1970s, Native Americans occupied Alcatraz Island; students of color shut down San Francisco State University; the Symbionese Liberation Army kidnapped the wealthy heiress Patricia Hearst and radical, offbeat and in some cases demonic preachers, hucksters and cult leaders preyed on young people and others.

It was a time of strange and rapid change that inspired some and frightened and angered others, leading to deep and to some seemingly irreconcilable divisions.

Nineteen seventy-eight would turn out to be a crucial year for San Francisco’s identity.

At the start of 1978, George Moscone was mayor, having beaten John Barbagelata, a conservative proto-Rudy-Giuliani-type candidate, in the mayor’s race three years before. The board of supervisors was the most diverse in the city’s history. Among the new members were Harvey Milk, a progressive, gay, Jewish politician who shared Moscone’s vision for San Francisco’s future, and Dan White, a reactionary former policeman and fireman, whose campaign had included a pledge to “eradicate malignancies that blight our cities”.

The city was not in great shape. The steady loss of jobs and population that had characterized much of the postwar era showed few signs of reversing. Crime, drugs, racial strife and other urban problems hit San Francisco hard. The Giants – the baseball team that had moved west from New York in 1958 – were exploring playing their home games across the bay in Oakland or leaving the Bay Area altogether. And the energy and excitement generated by the Summer of Love a decade earlier had faded into drug problems and a music scene that could charitably be described as uninspiring.

Facebook Twitter Pinterest Sid Vicious, left, and Johnny Rotten of the Sex Pistols perform at the Winterland auditorium on 15 January 1978. Photograph: AP

But the year shaped up as one of transformations. Throughout the spring, summer and fall, Harvey Milk would author and pass one of the strongest gay rights bills in the country; San Francisco’s avant garde and politically engaged punk scene came of age; residents voted on propositions that would become harbingers of the pro-business but socially tolerant politics that help define San Francisco today, and even the Giants generated real excitement.

In January, the Sex Pistols performed at San Francisco’s Winterland Ballroom. It was one of the first major punk shows in the city and gave two local bands from its nascent punk scene, the Nuns and the Avengers, an opportunity to play for a larger audience. The performance turned out to be the Sex Pistols’ last, but drew more attention to what was becoming an important movement in San Francisco.

Beginning in late April, the Giants started winning. They remained in first place most of the summer. A combination of ageing Giants heroes like Willie McCovey, established stars like Vida Blue and previously unknown players like Jack Clark, Mike Ivie and Bob Knepper provided fans with the most exciting and best team in years. The Giants success, and the enormous crowds they drew, put to rest talk of the team leaving town, at least for a few years.

Over in the North Beach neighborhood, the punk scene was growing, particularly once Dead Kennedys, a band with a name shocking to many, formed midway through the year. As punk continued to scare and outrage many older and more conservative San Franciscans, it took on a political edge that was unlike similar scenes in other American cities. San Francisco punks raised money for striking coalminers in Appalachia and sang out against racism, imperialism and the rightward trend in American politics. In September, a number of punk bands, including Crime, played an event at the Mabuhay Gardens, the celebrated punk venue, to raise money against a homophobic ballot initiative. The emcee for that event was Supervisor Harvey Milk.

Facebook Twitter Pinterest Willie McCovey of the San Francisco Giants. Photograph: Focus On Sport/Getty Images

Around the time the Giants were moving into first place in the National League West, the Bay Area residents were increasingly focused on news making its way north from Guyana. Jim Jones, a charismatic, radical and very strange preacher-turned-cult-leader who had once been a player in San Francisco progressive politics, had moved his Peoples Temple congregation to the jungle of Guyana with the ambitious goal of constructing a socialist utopia there. By spring of 1978, it was becoming clear that there was something very wrong with that experiment and Jones was becoming increasingly unhinged and dangerous.

In June, California voters went to the polls, and in one of the first volleys of the taxpayer revolt that culminated in the election of Ronald Reagan in 1980, approved Proposition 13, a bill that essentially froze property taxes and created problems for municipal services that still burden California cities such as San Francisco. People today who wonder why there are so few facilities and resources to support or help the homeless, the mentally ill or addicts in San Francisco, or why in such a wealthy city there is never enough money for services, must recognize that much of this began with funding cuts created by Proposition 13.

Then came November.

The month began with another election and major statewide initiative. Proposition 6 would have made it legal to fire any teacher in the state for being gay. The initiative lost.

Facebook Twitter Pinterest Jim Jones, the founder of the Peoples Temple, seated at center-right, with his family in 1976. Photograph: Don Hogan Charles/Getty Images

Following the vote, the US congressman Leo Ryan, who represented a district just south of San Francisco, traveled to Guyana to investigate concerns about the Peoples Temple, while Dan White, citing financial needs, resigned from the board of supervisors.

Between 15 and 30 November, the wheels came off.

Ryan’s brief trip to Guyana ended with the congressman, most of his traveling party and several Peoples Temple members shot and killed by the Peoples Temple security force. Shortly after, Jim Jones forced his entire congregation, more than 800 people, to drink cyanide-laced Flavor-Aid, resulting in one of the largest mass murders in history. Many of those killed were from San Francisco, and those left behind wondered how the city could move forward. Conservatives wasted little time blaming the tragedy on the excesses of the 1960s.

San Fran-disco: how Patrick Cowley and Sylvester changed dance music forever Read more

As Moscone sought to hold the city together, he also had to appoint Dan White’s successor on the board of supervisors. Conservative forces were worried Moscone would replace White with a progressive and shift the balance of power on the board, with a progressive majority. They encouraged White to ask for his old job back.

But White’s anger against Moscone and Milk had been brewing too long. When White went to City Hall on 27 November, ostensibly to plead for his old job, the political fights and battles of the 1970s erupted into deadly violence.

At City Hall, White asked to see the mayor, and Moscone invited him into his office. White then assassinated Moscone, walked down the hall and killed Milk, the member of the board of supervisors he despised most and who White blamed for persuading Moscone not to reappoint him.

Facebook Twitter Pinterest Harvey Milk, left, and Mayor George Moscone in April 1977. Photograph: Associated Press

When White murdered Moscone and Milk, he also destroyed the progressive revolution they were trying to bring. Moscone was replaced by Dianne Feinstein – the president of the board of supervisors and a pro-business Democrat close to the city’s powerful real estate interests.

Feinstein would go on to govern San Francisco for nine years. Her strength, words and inspiration brought the city together at its darkest hour. While more conservative than Moscone, she understood that San Francisco could not survive if the bigotries of people like White and Barbagelata lingered, and she continued Moscone’s work of embracing tolerance and promoting San Francisco’s diversity. Although she didn’t finish what Moscone and Milk were trying to do, she didn’t walk away from it, either. Thus, Feinstein split the difference between the progressive politics of Moscone and the reactionary views of his strongest opponents and in doing so, for better or worse, crafted the gestalt of contemporary San Francisco.

When it came to punk, Feinstein, unlike Moscone, seemed to hate the genre and sought to shut down shows and harass punks whenever she could. Yet punk endured. By 1979, the Dead Kennedys frontman, Jello Biafra, ran for mayor as the only progressive alternative to Feinstein, helping the punk concretize San Francisco’s reputation as a progressive political and cultural city.

Facebook Twitter Pinterest Klaus Fluoride, left, and Jello Biafra of Dead Kennedys perform in 1978. Photograph: Richard McCaffrey/Getty Images

By the end of November, few San Franciscans were thinking about baseball. The Giants eventually finished in third place and missed the playoffs, but their great season meant they were not leaving town, a blow that might have broken San Francisco in late 1978, given everything else that was happening.

Feinstein’s vision and the city she created beginning in 1978 is recognizable in San Francisco 41 years later. Almost every mayor, including the current incumbent, London Breed, has governed along those lines. We can never know what San Francisco would have looked like if Moscone had finally got his progressive majority on the board, if the political divisions of the era had deepened, if the Giants had left after the 1978 season, if punk had not re-energized a stale cultural scene or if Proposition 13 had not passed, but we can see how the legacy of 1978 is still very much with us in San Francisco.

Lincoln Mitchell is a writer and consultant based in New York and San Francisco. His new book, San Francisco Year Zero: Political Upheaval, Punk Rock and a Third-Place Baseball Team, was published by Rutgers University Press in October 2019. Follow Lincoln on Twitter @LincolnMitchell