There"s several options: many call for the water turned off and the water emptied from the copper pipe.
A mechanized repair clamp that is placed on top of the leaky area. Visit a hardware store or plumbing supply. This ought to be looked at as a temporary fix.
A variety of materials, many epoxy based, can be applied to the leaky area after the water is off and the pipe is drained, and the exterior pipe surface is cleaned well to removed grime, filth, and corrosion. These are also available in the plumbing section of a hardware store
Patch the pipe with a coupler. If you need to repair a leak swiftly and appropriately but you don"t have any extra pipe on hand – just a coupler and solder, that will do just fine. Cut the pipe on top of the pinhole leak so the pipe splits in two. De-burr the edge, and sand the edge. Apply your flux to both ends of the pipe and attach the coupler – then hit it with your torch and apply solder. This repair isn"t really as good as replacing the pipe – but it"s the next best thing.
Switch out the pipe
With one pinhole, there"s probably others that will be coming, Copper pipe is very easy to replace with some basic soldering skills, but call a plumber if in doubt. I would take out the defective area and inspect the inside carefully to establish the extent of the corrosion and how much should be replaced.