What happens if two galaxies collide very quickly?

What would happen if two galaxies collided very quickly (e.g. at near the speed of light)? Would they mostly just pass through eachother unscathed, or would there be very energetic collisions that would rip both galaxies apart, or would something else happen?

As MBurke said, the star in each galaxy will hardly be perturbed. Moreover, the chance for any two stars to collide is miniscule (there is about 1 star per pc$^3$ in the denser part of a galaxy, so the star fill about $10^{-30}$ of the volume).

However, most galaxies are also filled with gas in various phases (the so-called ISM -- inter-stellar medium and a warm/hot gaseous halo). The gas contents of each galaxy will crash into each other with dramatic effects:

1. the gas will shock highly super-sonicly and get heated up to enormous temperatures ($>10^{8-10}$K), such that is glows in the X-rays or even $\gamma$ rays;

2. the gas will get stuck in the place of the collision while the stars (and dark matter) travel on after the encounter.

Since gas makes only a small fraction of the total mass of a galaxy, the removal of their gas will have little effect on the dynamics of the galaxies, though they will stop forming new stars or feeding an AGN.

In fact, such collisions are observed for not for galaxies, but for galaxy clusters (when the individual galaxies are mostly unscathed, but the cluster gas gets stuck in the middle), such as the bullet cluster.

Have 2 people stand in opposite corners of a large empty room each with a jar of marbles. Have them roll these at each other all at once as fast as they can, and you will get a pretty good answer to your question.

97% (or thereabouts) of a given galaxy is empty space. Most of one is going to pass harmlessly through the other, though you are likely to get a few collisions. At or near the speed of light, gravity will have very little effect as well, so a few orbits will be perturbed, but any given star will hardly notice.

I suspect (though I haven't the expertise to say definitively) that the radiation increase during the ~100,000 years or more that this collision would take (assuming the galaxies were of approximately the size of the Milky Way and that they hit exactly edge on) would be significant to any creatures living in your galaxies.

If by the off chance (I'm talking about lightning-striking-a-shark-currently-eating-a-recent-lottery-winner kind of chance) the supermassive black holes at the center of these two galaxies collided, the speed would be no obstacle, and they would combine. The angular momentum would certainly rip the new black hole from one of, or likely both, of the colliding galaxies. This would be bad for them. I propose sending this as a "What If?" question to XKCD. He seems to have the time to do the math on questions of this nature and follow as far as it leads.