Migrare un repository GIT

From Ability
Jump to: navigation, search

Migrare un repository senza avere accesso diretto al server

Clonare il vecchio repository:

git clone git@<old_repository_url>

Eseguire il Checkout di tutti i branch remoti:

for remote in `git branch -r | grep -v HEAD` ; do git checkout --track $remote ; done

Aggiungere il nuovo remote repository:

git remote add new_origin git@<new_repository_url>

Eseguire il push di tutti i branch:

git push -u --all new_origin

Eseguire il push di tutti i tags:

git push --tags new_origin