When the scruffy Greens marched into the German parliament nearly four decades ago in jeans and sneakers, they were sidelined and ridiculed. Today, the party has a legitimate shot at governing Europe's largest economy.

With Angela Merkel's coalition hanging by a thread, the possibility of a Green chancellor is a hot topic in Berlin. The party overtook her Christian Democrat-led bloc in polls this month. Robert Habeck, the stubble-cheeked Green co-chairman, would defeat Merkel's heir apparent in a contest to lead Germany.

That raises the question of how the nation would be run by a party that in 1998 proposed tripling gasoline prices and, in 2013, suggested banning meat in canteens every Thursday. Even though the Greens now are a mainstream party for urban professionals, many investors still get the jitters.