Never, I mean never use galvanized pipe without a non- conductive material (brass) between poly pipe, PVC, or copper. Why? Any time you use Galvanized with any of the before mentioned material, you get electro analysis. On my last job, I wished I took a picture when I took of the faucet> they would freak out at the corrosion.
You didn't mention what kind of material the pipe is. If it was PVC, they make many type of repair type material. My favorite is the repair coupling. Other types, if you do not use or want to glue are the compression couplings.
If you have a home base or home depot around you, they carry these types of repair couplings.
Myself, if it's a riser, I use the cheap cutoffs, though never on a new install. A bag (30 pieces) of cutoff nipples are around $4.
J-LC Landscaping & Maintenance Gardening
C-27 CA. Contr# 770044