After the previous exercise, you’ve gotten pretty good at managing code in your local repository, but what about team development? How does it work? We can put the version warehouse on the Internet, developers push their latest version to the online warehouse, at the same time, the online warehouse of the latest code to their own local, so that you can work together.

So what online warehouses can we use? The most popular online warehouse abroad is GitHub, but in China, we also have our own online warehouse, code cloud, this code cloud is not jack Ma. We click on the link to sign up for an account.gitee.com/Next, let’s build a new warehouse.If you’ve ever used GitHub, this should be easy. We created such a repository.This is what it looks like when it’s created.This is an empty warehouse, there’s nothing in the warehouse, and then the red box is your warehouse address. So we’re going to take the RRD project and we’re going to bring it to this online repository. We enter

git remote add origin https://gitee.com/blizzawang/lianshou.git
Copy the code

This is followed by your warehouse address, and then enter

git push -u origin master
Copy the code

If there are a lot of files, you need to enter -u for the first commit, but you can omit the -U after the commit.If the Git console displays this, the push is successful, and we refresh the page.This shows that our project has been successfully pushed to the online warehouse. We just pushed the project to the online repository with two lines of instructions, and LET me explain those two lines of instructions. One of thegit remote add origin https://gitee.com/blizzawang/lianshou.git“Origin” means to mark the location of the warehouse, which means to give the warehouse a name. The name is origin, which you can choose. So when we type in the second line of instruction,git push -u origin masterOrigin stands forhttps://gitee.com/blizzawang/lianshou.git. With that said, we can reduce the two sentences to one sentence, so you can write the same.

git push -u https://gitee.com/blizzawang/lianshou.git master
Copy the code

The effect is the same either way.