From git-remote manual:
set-url
Changes URL remote points to. Sets first URL remote points to matching regex <oldurl> (first URL if no <oldurl> is given) to <newurl>. If <oldurl> doesn’t match any URL,
error occurs and nothing is changed.
With --push, push URLs are manipulated instead of fetch URLs.
So you should additionally execute:
git remote set-url --push origin ssh://user@example.com:XX/package/name.git