What he said. If you're still using a standard power alternator (70a or less) and want to keep the wire intact, you need to keep the two halves plugged together or literally everything in the truck is disconnected from the battery.
If you're using a higher amp alternator, you're going to run a charge wire directly to the battery/starter relay anyway. But you still need to keep the wire connected under the dash and just disconnect it under the hood as he mentioned.
You can't easily eliminate the entire wire because it's basically the backbone of the entire chassis harness.
If you want to eliminate part of the system, you'll have to dig into the harness and follow it along until you reach the minimum operating distance and then re-splice the new ends together to complete the circuit again.
Easiest then, and likely safest, to keep the factory connector and simply plug it back together after removing from the gauge.
If the connector is compromised and you have to replace it anyway, then you can shorten the wire by removing as much as you're comfortable with and then splicing it back together.
Paul