How to push a local project to a code hosting platform using Git? 【Gitee, GitLab, GitHub】

Add a local project to a Git repository using Git

introduction

This blog post uses Git to add a local project to a Git repository, and implement crawling and push

Git installation and little turtle installation and configuration

Set up a Git account

View current Git account name

git config user.name

insert image description here

View current Git mailbox

git config user.email

insert image description here

Set Git account name

git config --global user.name = "王会称"

insert image description here

Set up Git mailboxes

git config --global user.email "[email protected]"

insert image description here

Check again if the setting is successful

insert image description here

Enter the git global configuration file to modify

vi ~/.gitconfig

insert image description here

Log in to Gitee's official website and register an account

gitee official website

If there is no account, you need to create a new one and bind the specified email address

New warehouse

New warehouse

insert image description here

Click Create to create successfully

Git generates SSH public key

Open Git Bash

insert image description here

Enter the following command in the Git window to generate the secret key

ssh-keygen -t rsa -C "[email protected]"

insert image description here

Enter all the way, and finally check the generated secret key

insert image description here

Generated successfully

Gitee configure public key

Direct access: https://gitee.com/profile/sshkeys to enter the key configuration interface

insert image description here

Configured successfully

insert image description here

Configure the turtle SSH address

Right click on TortoiseGit --> select Settings
insert image description here

Configure ssh.exe in Git file usr
insert image description here

Apply and OK to exit

Crawl the project

Click Clone, select SSH, copy the git address

insert image description here

Clone the file to the specified folder, right-click and select Git Clone

insert image description here

Select ok to clone the project

insert image description here

Successfully crawled project

insert image description here

Push the local project to the Git repository

Create a new test .txt file in the crawled project

insert image description here

Commit to submit the code first, and then push the code to the Gitee repository
insert image description here

Fill in the submitted document information

insert image description here

Click Commit&Push to submit the code

insert image description here

Submitted successfully

Open Gitee to view submitted files

insert image description here

Click to view the contents of the file

insert image description here

The submission is successful, the test is successful~

Delete Gitee repository

Enter the warehouse, select Manage, find Delete warehouse
insert image description here

Click delete, delete items need to be careful, once deleted, can not be retrieved, delete the warehouse need to verify the account password
insert image description here

successfully deleted
insert image description here

This is the end of this article. If this article is helpful to you, please give it to the blogger (Like, Favorite, Comment

If you encounter any technical problems, you can comment in the comment area or privately message me, and it will be solved in place!

If you encounter any technical problems, you can comment in the comment area or privately message me, and it will be solved in place!

Thanks for your support~

Guess you like

Origin blog.csdn.net/weixin_45526437/article/details/121596998