»Technical toss»Git code version control skill: manage and push multiple warehouses at the same time
Git is a popular version control system. Through Git, we can manage code, managed code, manage our own works, and synchronously push multiple version databases by adding remote repositories
preface
Github is the most popular Git code hosting website. However, given that Github is a foreign website, sometimes there will be network problems when downloading or pushing. So many people usually put a warehouse abroad and a warehouse at home for backup or synchronization. At present, the domestic Git code hosting system has the Gitee of open source China,Visually, we will include Tencent Cloud's Coding, AliCloud's Ali Code, and Github or Gitlab abroad. We may push the code to multiple warehouses at the same time. At this time, it is very important to push the code synchronously with one click, which can be done directly with one command.
command
Generally, we cangit cloneTo download a code base
git clone git@code.aliyun.com:sp91/Payjs4Woo.git
We can think of this warehouse as the main warehouse, and then add several sub warehouses
Then we can usegit remote -vCommand to view how many warehouses there are
In the above figure, the main warehouse is in the red box, and the others are sub warehouses. If there is no problem, we can submit push, as shown below
As can be seen from the figure, it is very convenient to submit code to four code repositories at one time.
Disadvantages: After testing, when using git pull alone, only the code of the main warehouse will be pulled, not the code of other warehouses, so this method is more suitable for the operation of submitting code only using push
Postscript
AliCloud discovered AliCloud's AliCloud code, which should belong to the AliCloud developer platform. Since AliCloud is relatively hard in China, AliCloud also synchronously hosts Git code to AliCloud's warehouse.