Hey George, thanks for this guide!
I wanted to add a couple of things though - in my scenario I'm migrating from a server to cloud, and there's a bit of transition period where we'll need to update the mirrored repo with new commits and branches
Setup the new location to always mirror on push:
git remote add --mirror=push gitcloud git@example.com:/new-location.git
Then to update the new location (assuming the cloned mirror is the origin remote):
origin
git remote update --prune origin && git push gitcloud
As you're aware, --prune will remove any local refs not on remote, and these deletions will also be mirrored up on the push!
--prune
push
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey George, thanks for this guide!
I wanted to add a couple of things though - in my scenario I'm migrating from a server to cloud, and there's a bit of transition period where we'll need to update the mirrored repo with new commits and branches
Setup the new location to always mirror on push:
Then to update the new location (assuming the cloned mirror is the
origin
remote):As you're aware,
--prune
will remove any local refs not on remote, and these deletions will also be mirrored up on thepush
!