[Use of Gitee] Simple use of Gitee, view/create SSH public key, create repository, pull code, submit code

recommended reading

Hello everyone, I am a Buddhist engineer ☆Tranquil Little Demon Dragon☆ . I update Unity development skills from time to time. If you think it is useful, remember to click three times.

I. Introduction

This article briefly introduces how to create a repository, pull code, and submit code on Gitee.

This article is as simple as possible, so that beginners can proceed smoothly.

Two, the text

2-1. Install Git

To pull and submit code, you need to install Git, and you need to download an installation package from Git's official website https://git-scm.com/downloads :

insert image description here

After the installation is complete, find "Git" -> "Git Bash" in the start menu, and run this program:
insert image description here
something similar to a command line window pops up, indicating that Git is installed successfully:
insert image description here

2-2. View/create SSH public key

Before starting, you need to set up your account and email address. If you don’t remember whether you have set up an account password, you can check:

$ git config --global --list

As shown in the figure:
insert image description here
Then if it is not set, you need to set the account, email, and password first:

$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"
$ git config --global user.password "pwd"

Then check your own SSH public key. You can first check whether you have created a public key:

$ git cd ~/.ssh
$ ls -al ~/.ssh

insert image description here
If there are id_rsa files and id_rsa.pub files, it means that they have been created, and you can continue to the next step.

If not, you need to create a ssh keys:

$ ssh-keygen -t rsa -C "user.email"

Enter your password after pressing Enter to generate id_rsa and id_rsa.pub files.

2-3. Set up SSH in Gitee

After logging in to Gitee, click on the avatar, select Settings, and find the SSH public key:
insert image description here
Then, you need to copy the id_rsa.pub obtained in the previous step into the input box:

$ cat ~/.ssh/id_rsa.pub

insert image description here
Then copy it to the input box and select OK:
insert image description here
the addition is successful:

insert image description here

2-4. Create version library

There are two cases here:

1. The project has been completed locally, or a part of the project is completed and needs to be uploaded to the cloud.
2. Prepare to create a new project in the cloud, and then update it locally for development.

In fact, the operation steps in the two cases are similar:

(1) You need to create a new project on Gitee first:

insert image description here
(2) Copy the git address:
insert image description here
(3) Find an empty folder, right-click to select Git Bash Here:
insert image description here
(3) Pull the Git warehouse of the remote server to the local:

Initialize the folder first:

$ git init

Clone Gitee's remote repository:

git clone git@gitee.com:itMonon/demo_-test.git

Here, if you already have a completed project, just copy the project to this folder and upload it.

If there is no completed project, just create a new project in this folder and upload it.

2-4. Pull code

Here, regardless of the issue of branching, the code is pulled directly:

git pull origin master

master is a branch, if there are other branches, fill in the branch name, here is the default.

2-5. Upload code

The command is as follows:

$ git add .//添加所有修改
$ git commit -m "remark" //提交代码

3. Postscript

If you find this article useful, don’t forget to follow it, follow it so you don’t get lost, and continue to share more Unity dry goods articles.


Your likes are your support for bloggers, please leave a message if you have any questions:

The blogger's homepage has contact information.

The blogger also has many treasured articles waiting for your discovery:

column direction Introduction
Unity3D development small game Small Game Development Tutorial Share some small games developed using the Unity3D engine, and share some tutorials for making small games.
Unity3D from entry to advanced getting Started Get inspiration from self-study Unity, summarize the route of learning Unity from scratch, and have knowledge of C# and Unity.
UGUI for Unity3D UGUI A full analysis of Unity's UI system UGUI, starting from the basic controls of UGUI, and then comprehensively teaching the principles of UGUI and the use of UGUI.
Reading data of Unity3D file read Use Unity3D to read txt files, json files, xml files, csv files, and Excel files.
Data collection of Unity3D data set Array collection: Knowledge sharing of data collections such as arrays, lists, dictionaries, stacks, and linked lists.
VR/AR (Virtual Simulation) Development of Unity3D virtual reality Summarize the common virtual simulation needs of bloggers and give case explanations.
Plugin for Unity3D plug-in Mainly share some plug-in usage methods used in Unity development, plug-in introduction, etc.
Daily development of Unity3D daily record It is mainly used by bloggers in daily development, methods and skills used, development ideas, code sharing, etc.
Daily BUG of Unity3D daily record Record the bugs and pitfalls encountered during the development of the project using the Unity3D editor, so that later generations can have some reference.

Guess you like

Origin blog.csdn.net/q764424567/article/details/132147111