[Operation and Maintenance] Migrate the Git project to a new address

[Operation and maintenance] Migrate the Git project to a new address, including all branches and their submission records, etc.

migration project

1 Create a new empty project

newProject

https://127.0.0.1/new/newProject.git

2 Clone the old project

git clone --mirror https://127.0.0.2/old/oldProject.git

Enter the old project directory

cd oldProject

3 Change the remote address of the old project to a new project

git remote set-url  origin https://127.0.0.1/new/newProject.git

4 Push to the new git address

git push -f origin --mirror

5 done

Guess you like

Origin blog.csdn.net/G971005287W/article/details/131533978