Git Repository Migration Guide: How to Elegantly Change Remote Repository Address
Git Repository Migration to New Remote Repository Address Guide
Moving a repository to a new remote address is as simple as adding a new remote and pushing. Here are the detailed operation steps.
Step Instructions
Just like moving household items to a new house, first tell Git the new address, then move all the content.
1. Add New Remote Repository
Using new-origin
as an example, execute:
git remote add new-origin new-repository-address
2. Push All Branches
Note: The parameter uses two dashes --
, not Chinese long dashes.