Home >Development Tools >git >How to use gitee repository? (user's guidance)
Gitee is a domestic open source code hosting platform, similar to Github, a similar global website, but it places more emphasis on the needs of domestic users. Using Gitee in China can speed up code transmission and improve code access speed. Below is a brief guide to help you get started with Gitee.
1. Create a Gitee account
First, you need to register an account on the Gitee website (https://gitee.com/). Click the "Register" button in the upper right corner of the page, fill in the necessary information and set a password. Upon completion, you will receive a Gitee account and access to various repositories and projects on Gitee.
2. Create a new repository
To host code on Gitee, you need to create a repository named "Repository". After logging in, click the "New Warehouse" button in the menu bar at the top of the page. In the pop-up window, you need to fill in the relevant information of the warehouse, for example:
After completion, click the "Create Warehouse" button to complete the creation of the new warehouse.
3. Upload code
After you have created a warehouse, you need to upload the code to the warehouse in Gitee.
You can use the command line to move to the directory where your local code repository is located using the following command in your local terminal:
cd <your_local_repository>
On your Gitee repository page, find SSH Clone URL or HTTPS Clone URL and copy this URL to your clipboard.
Next, use the following command in your local terminal to get started by pushing your repository to Gitee:
SSH
git remote add origin git@gitee.com:<your_gitee_username>/<your_gitee_repository>.git git push -u origin master
HTTPS
git remote add origin https://gitee.com/<your_gitee_username>/<your_gitee_repository>.git git push -u origin master
You will be asked to enter the username and password you use on Gitee.
4. Set up Collaborator
If you have a project or repository, you may want to give others some permissions to access or manage it. To add a person as an administrator or collaborator of a Gitee repository, do the following.
5. Clone the remote repository
If you want to clone the code in the Gitee repository locally for editing or use, you can use the following command to clone its repository.
git clone https://gitee.com/<your_gitee_username>/<your_gitee_repository>.git
This will create a new folder called "
6. Conclusion
Gitee is an overly powerful code hosting platform. If you are looking for a better alternative than Github, then it is a good choice. Below is a simple getting started guide for you to start using Gitee. As you get deeper into it, you'll find it more fun and satisfying.
The above is the detailed content of How to use gitee repository? (user's guidance). For more information, please follow other related articles on the PHP Chinese website!