Just don't
Although your question is about visas, and you have been given good answers related to that, this site also deals with travel as a whole.
I am inspired by someone, who travel from Germany to Pakistan. Now I am planning a bicycle journey from Pakistan to end of the Europe or maybe return back to Pakistan with different route.
Such a trip on an airplane requires considerable preparation, let alone on a bicycle! Just because you are inspired by someone does not mean that it did not take that person years of experience and strength and meticulous preparation and some failed attempts before venturing out on such a long road trip on a bicycle.
First focus on those things, visas can come later.
As of now, you don't even know the route. Just because Google Maps can draw a line between two countries does not mean the road is traversable by a bicycle, or at times even a car. By the way, the time it will take to cross certain countries on a bicycle on your path will make it a regular visit as opposed to a short transit.
One of the other answers mentions
You cannot get a visa at the borders you will be crossing, as the Pakistani passport is one of the most restrictive in the world when it comes to freedom of travel.
Even if you had a German passport like he did, visas would be the last thing to worry about. First focus on the cycling part of it, the fitness part of it, the money part of it, the endurance part of it.