Only replace origin remote if it matches first portion of ref.

To make sure we don't update a .origin file to point to a tree from a
subscription which  doesn't match what's deployed, we only update the .origin
file if the remote name matches the first portion of the reference.
Rename poor choice of gi.py script.