If you want to move a remote repository to a new server you can follow these steps to transfer all you data.1

Fetch remote data

In your local clone, fetch all remote data.

$ git fetch origin

Check for local branch copies

Check if you have a copy of each remote branch. Only local branches will be pushed to the new remote server in the next step!

List all branches

$ git branch -a

Checkout missing branches

Make also sure, that all existing, local branches, are up to date.

$ git checkout -b develop origin/develop

Recheck branches

$ git branch -a

Update remote url

Now update the remote configuration for your local clone.

$ git remote set-url origin <remote-url>

Push all branches and tags

Finally, push all files, history data and tags to the new remote.

$ git push --all
$ git push --tags


  1. https://www.smashingmagazine.com/2014/05/moving-git-repository-new-server/ []

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht.