How to switch remote server in gerrit

        When the remote server you are using needs to be replaced, that is, the code is transferred to the new gerrit server, do you need to reconfigure the key and pull the code again? In fact, there is no need to pull a copy of the code again, and it will take too much trouble, just use the command to switch the remote server.

        The following is an example of switching from 192.168.8.67 to 192.168.1.80 remote server.

The first step is to check your current remote server address:

Use git remote -v to view the current URL:

       After using the git remote -v command, you can see that the current remote server is 192.168.8.67, which is the address of the remote server to which local changes will be submitted when you use the git push command. 

Step two:

Reset the URL with git remote set-url origin <URL>.

    After using git remout set-url origin <URL> to change the address of the response, and then use git remote -v to view the current remote server address, you can find that it has been switched to 192.168.1.80.

third step:

In the second step, the remote server has been successfully switched. At this time, the code can be pulled normally by using the git pull command.

 

Guess you like

Origin blog.csdn.net/weixin_42433094/article/details/126071791