Thanks
Firstly, there was no treaty that ended the Cold War. There were a series of agreements as well as geopolitical developments that signaled the end of the Cold War, but no overarching treaty. Now where the "not one inch" comes up is in the negotiations for the unification of Germany.
By 1989, it was becoming increasingly clear to all concerned that German unification was in the cards and the West German government was going to take the lead in a future German government. German unification would coincide with a formal end of the Second World War and a final peace treaty. The Soviets maintained a large armed force within Germany as part of its occupation rights as one of the four victorious Allied powers. In the weeks after the opening of the Wall and the political implosion of the GDR, German Chancellor Helmut Kohl and his somewhat independent Foreign Minister Hans-Dietrich Genscher were making aggressive overtures for German unification. Part of the West Germans' playbook was intimating that unified Germany would be neutral and either withdraw from NATO or not integrated into it like France. This caused considerable alarm in Paris, London, and Washington. For one thing, it would be a de facto end to the NATO alliance while Warsaw Pact and the USSR still existed. Among Western European leaders there still was a fear that a resurgent Germany would fall back into its old habits of militarism as it would need to plan for its own defense. One of the unstated political rationales for NATO was that it harnessed Germany into a collective structure that restricted its supposedly innate militarism that led to two world wars. The old canard of NATO was that it was to keep the Soviets out, the US in, and the Germans down.
This was the context of US Secretary of State James Baker's 9 Feburary 1990 meeting with Gorbachev where he floated the idea of not moving NATO "one inch" beyond Germany. Baker pushed Gorbachev into a hypothetical that if there were such a guarantee, would the Soviet leader drop his opposition to a unified Germany being a NATO member. Gorbachev did not make any firm commitment here, but in the subsequent weeks would continue to press the idea that unified Germany should be neutral.
Baker's idea did not have formal approval from Washington. He was on the tail-end of an extensive tour and Bush was apparently quite upset that he was floating an idea that restricted NATO's development. But events overtook the question of NATO as Kohl, right after the Baker meeting, was able to get Gorbachev to publicly assent to Germans' right to self-determination. Gorbachev subsequently floundered over the issue and future NATO membership became tabled. The Western Allies managed to persuade Kohl to make NATO membership a non-negotiable part of unification, something Kohl was predisposed for anyways, and the negotiations were focused on how the former GDR would be integrated into NATO. The subsequent 2+4 agreement that unified Germany had provisions limiting the initial deployment of NATO military forces into the former East Germany. Initially, only German territorial units (the equivalent of the US National Guard and not directly integrated into NATO) could deploy in East Germany while the Soviets maintained their ground forces were present. The regular Bundeswehr could move into these areas after the withdrawal was complete and NATO forces could operate there with the assent of the German government. The Germans also agreed to formally denuclearize the area and pay a substantial portion of costs of maintaining and withdrawing the Soviet forces in Germany.
Yeltsin and subsequent Russian leaders would maintain that the 2+4 agreement precluded NATO's eastern expansion. Only a very generous reading of the treaty allowed for this; one could see that the spirit of the agreement meant this was a sensitive issue and there was a strong sense that the West was dancing on the grave of the Soviet Union. While Baker and Bush were cautious about NATO expansion, others within American decision-making were more blatant. The National Security Revitalization Act of the Congressional Republicans' Contract with America stated that Poland, Hungary, the Czech Republic, and Slovakia should be permitted to join NATO in the near future and
that any other European country emerging from communist domination should be invited to become a full member of NATO, provided it meets such standards and commitments.
Unlike the 1990 negotiations over Germany, the Russians did not have much of a diplomatic presence in talks over NATO enlargement.
The "not one inch" pledge has taken on mythic proportions, particularly within Russia. But it was not a formal pledge, but a negotiating point floated by a very high-placed US official. More importantly, Gorbachev did not take Baker up on this pledge and transform a hypothetical point into a concession. Instead, Gorbachev insisted on what was a dead-letter, a neutral Germany, and as events overtook the Soviets, sought what he felt were better concessions than limiting NATO. Gorbachev's foreign policy advisor Anatoly Chernyaev argued that nuclear security was more important than NATO:
Real security of the USSR did not depend on the amount of forces in the West and in the East, and their [conventional] armaments.
Since neither Germany or even Poland had nuclear arsenals, getting pledges to denuclearize Germany was seen at the time as an important concession.
But to reiterate, there was no formal pledge to not expand NATO. The Soviets did not demand it and they could have. They did place demands that at the time seemed quite stringent such as denuclearization, staged German expansion into the GDR, and paying the Soviets to leave. And the West did comply, even when the Soviets balked at some of their end of the deal such as demanding an upfront payment rather than a staged one agreed upon. Part of the sourness over subsequent trajectory of the post-2+4 world was due to the fact Gorbachev had a bad hand in 1990 and he played it poorly.
Sources
Sarotte, M. E. Not One Inch: America, Russia, and the Making of Post-Cold War Stalemate. New Haven: Yale University Press, 2022.
Spohr, Kristina. Post Wall, Post Square: How Bush, Gorbachev, Kohl, and Deng Shaped the World After 1989. New Haven: Yale University Press, 2020.