[Getting started with Git]---gitee registration and code submission

1.What is Gitee?

giteeIt is gita domestic platform based on code hosting and R&D collaboration, where personal or company code and open source projects can be hosted. giteeURL:https://gitee.com/

2.gitee registration

①Log in giteeto the website and come to the following interface, click Register in the upper right corner
Insert image description here
②Follow the following steps to complete gitee registration
Insert image description here
③After registration, the following interface
Insert image description here

3. Installation of git tools and graphical interface tools

To conduct code hosting, you need to install the following software .
Insert image description here
Among them git-2.33.1-64-bit.exeis the git command tool, but inputting commands to control gitee is not so friendly to us, so we need to install a TortoiseGit-2.12.0.0-64bit.msigraphical interface tool based on the git command tool to facilitate our operation!
Step 1:
① Double-click git-2.33.1-64-bit.exe, keep clicking the next button, and use the C drive path of its default installation (not recommended to change)
Insert image description here
Insert image description here
Insert image description here

③Right-click in the blank space and click "Show more options". When you see Git GUI Hereand Git Bash Heretwo options, it means the installation has been successful.
Insert image description here
Insert image description here
Step 2:
①Double TortoiseGit-2.12.0.0-64bit.msi-click the installation and keep clicking nextuntil the final click finishis completed
Insert image description here
Insert image description here
Insert image description here
. ②The previous ones are default. NameEnter your user name in , enter Emailyour email address in , and finally click Next to complete the installation.
Insert image description here
NameFill in @the English name
Insert image description here
Emailoption and fill in your Giteeemail address. If the "Public email address" option of your email is checked Select, remember to uncheck.
Insert image description here
Insert image description here
③ When the installation is complete, click "Show more options". When you see the following options, it means the installation has been successful. Note
Insert image description here
: You must first install git-2.33.1-64-bit.exethe git command tool, and then install TortoiseGit-2.12.0.0-64bit.msithe graphical interface tool.

4.gitee warehouse creation

① Click "New Warehouse"
Insert image description here
② Make simple settings for the warehouse
Insert image description here
③ After the creation is completed, it will jump to the following interface, indicating that the warehouse has been created and
Insert image description here
the warehouse is open source:
① Click "Manage"
Insert image description here
Insert image description here

②Scroll down, click "Open Source", click "I Commit", and finally click "Save", your warehouse will be "Open Source".
Insert image description here
Delete warehouse:
Click the "Management" interface, click "Delete Warehouse", finally enter the content of the prompt, and click the "Confirm Delete" option.
Insert image description here
Insert image description here

5. Link the local warehouse to the remote gitee warehouse

① In the warehouse interface, click "Clone\Download" and select the "http" URL to copy
Insert image description here
② Select a suitable location to store the cloned remote warehouse, right-click in the blank space, and click "Show more options". By default, the just-filled fields will be filled in. To copy the gitee remote URL and local warehouse path, just click "OK".
Insert image description here
Insert image description here
Insert image description here
Insert image description here
③ You can see the local warehouse with the same name as the gitee warehouse you just created (that is, the remote warehouse is cloned into the local warehouse). Click on it. When you see the file attached when creating the gitee repository, you can see that .gitthe file indicates that the remote repository is connected to the local repository.
Insert image description here
Insert image description here
Some students cannot see .gitthe file because it is a hidden file. Click the "Show" option in "View" and check the "Hidden Items" option.
Insert image description here
So how to submit code? We use VS to write code. The steps are as follows:
① When creating a project, select the project storage location 与远端仓库建立联系的本地仓库文件夹
Insert image description here
② In the created project, write the following code:

#include<stdio.h>
int main()
{
    
    
	printf("hello gitee");
	return 0;
}

Insert image description here
We have written test.cthe code file and stored it in the local repository, so how to submit it to the remote Gitee repository? Then you need to use giteethe three axes: add, commit, push, let us learn how to use them together!

6.git three-axe

add

① In the blank space, right-click, click "Show more options", click “TortoiseGit", add
Insert image description here
Insert image description here
click "OK", the following interface will appear, because your VS is using the project at this time, and you need to turn off the project in VS. project (or close VS directly), and then restart add:
Insert image description here
addadd the code to the local warehouse

commit

Insert image description here
Insert image description here
commit: Submit code to the warehouse

push

Insert image description here
Insert image description here
push: Push the addition operation to the remote warehouse
. Note: When pushing for the first time, you need to fill in your username and password, which correspond to the mobile phone number and password you set when you registered.
Insert image description here

Insert image description here
After using the Sanbanax operation, you can see the code files we pushed in the remote warehouse (remember to refresh below).

7. Frequently asked questions about gitee code submission

Question 1: What should I do if I enter the wrong username and password for the first time?
Insert image description here

① Search for "Credential Manager" in the Windows "Start" box, click in
Insert image description here
② Select “windows凭据”, find the one you created today gitee凭据, expand it and delete the credential.
Insert image description here
③ Use Sanbanaxe again. This time, enter the username and password correctly and you can push the code file to the remote warehouse normally.
Question 2: After submitting the code file, is there no green dot in the contribution?
① Check the gitee mailbox of the remote warehouse
Insert image description here
② Follow the steps below to check the local mailbox
Insert image description here

Insert image description here
Insert image description here
Insert image description here
Insert image description here
③If giteethe warehouse email is inconsistent with the local warehouse email, modify the local warehouse email to be consistent with the gitee email. You will see the little green dot reappear the next time you submit.

Guess you like

Origin blog.csdn.net/m0_74288306/article/details/133107049