Earth's magnetic field is way too weak to repel against with the force required to launch anything into orbit. Actually, it's really easy to demonstrate that. Take one fridge magnet, place it on the kitchen scale, and write down its weight. Then turn the magnet around and weigh it also with its polarity reversed. You shouldn't see any difference and the scale will show identical weight in both cases, something you'd expect to be much different if Earth's magnetic field was so strong that it would substantially negate gravitational acceleration in one case, and increase attractive force when the magnet's polarity would be flipped the other way around.
Regarding tube tunnel with electromagnets, Earth's escape velocity on its surface is 11.2 km/s (that's 40,320 km/h or 25,053.7 mph!). Some of this velocity is already provided by the Earth's own rotation, depending on how far from equator the launch site would be (1670 km/hr at equator, 0 at true poles), but the majority would still have to be provided by the launch system. That's a lot to ask of a maglev / railgun system and would require either tremendous power on a relatively short track (a few kilometers perhaps) for accelerations that no human could survive, or roughly 1,472 km (914 mi) long track to keep acceleration down to 4 g, if the launch system would be at equator.
To achieve Low Earth Orbit (LEO), required target velocity should reach approximately 8 km/s (28,800 km/h or 17,895 mph) once in LEO, but since there would of course still be all the atmosphere in the way once it would exit the launching system, the exit velocity would have to be much larger than that to negate atmospheric drag. The initial supersonic shock would also require incredibly tough materials to withstand the shock forces and aerodynamic heating, and the projectile would likely still require some means of propulsion of its own, if for nothing else, then for orbital maneuvers, trajectory corrections, and deorbit burn. Oh, and in case of a human rated system, it would have to have launch escape and safe descent systems too, all of it adding to its size and weight.
So as you see, there are some major drawbacks to such horizontal launching systems using electromagnetic propulsion, and you'd still have to carry most of the systems that are used with rocket launches onboard, even if you exited the launch ramp at high velocities. A bit more about the hurdles to using railguns as space launch systems is also discussed in two similar questions:
Earth's magnetic field can however be useful as an in-orbit attitude control, mainly to stabilize satellite's alignment along the long axis and/or keep a particular part pointing towards nadir, using what we commonly refer to as magnetorquers. They work in a similar way to how a magnetized needle self-orients towards magnetic poles, only using powered electromagnetic coils. But, as you probably expect by now, they wouldn't really be reliable over the Earth's magnetic poles due to oscillation in the magnetic field, so they would leave their coils unpowered over those areas if the satellite is in a polar orbit. For more information on how they work, I suggest searching our site using the magnetorquer tag.