The heads of state and government of the six leading industrial countries (France, Germany, Italy, Japan, the United Kingdom and the United States of America) met in 1975 for the first time to discuss the global economy. They were joined in 1976 by Canada, thus forming the G7, and in 1998 by Russia (G8). Following the Russian annexation of Crimea, the G7 nations decided in March 2014 to meet without Russia until further notice. Since 1977, the President of the European Commission has been attending G7 summits and, with the adoption of the Lisbon Treaty, the President of the European Council participates too. The two presidents represent the European Union.
The topics discussed at the G7 have evolved, from the initial focus on economic issues around oil and the collapse of the fixed exchange rate system, to today's wide-ranging of issues, including environmental ones.
It very much depends on the rotating presidency to determine the agenda of the summits. In 2015 in Elmau (Bavaria), under Germany's Presidency, the G7 discussed environmental topics including resource efficiency and the fight against marine litter (the full report of the leaders' discussions is here). These were also on the agenda of the G7 summit in Ise-Shima in May 2016 under Japan's Presidency. The 2016 G7 Environment Ministers' Meeting adopted the Toyama Framework on Material Cycles, as a contribution to the G7 Alliance on Resource Efficiency The 2017 G7 Environment Ministers' Meeting will take place in Bologna on 11-12 June, under Italy's Presidency.
The G20 is an informal forum for discussion between major OECD and non-OECD countries on issues related to global economic stability. It was created as a response to the growing recognition that key emerging economies such as China, India and Brazil were not adequately represented at the core of global economic discussion and governance.
The following 19 countries plus the European Union (represented by the Presidents of the European Council and the European Commission) are members of the G20: Argentina, Australia, Brazil, Canada, China, France, Germany, India, Indonesia, Italy, Japan, Mexico, Russia, Saudi Arabia, South Africa, South Korea, Turkey, the United Kingdom and the United States of America.
See also the G20 Web-Site.