[Essay] Gitee — Gitee warehouse creation & SSH public key generation (2)

Please add a picture description

  • Column: 【Git】

  • Author Author: I am the dog in the night

  • Personal profile: A CV engineer who is working hard to learn technology, focusing on basics and practical sharing, welcome to consult!

  • Welcome everyone: This is CSDN, where I summarize knowledge. If you like it, please keep repeating. If you have any questions, please private message

Article directory

  • foreword
  • 1. Use of Gitee
      • 1. Log in to the official website of Gitee
      • 2. Create a warehouse
      • 3. Initialize the readme file
      • 4. The warehouse is created
  • 2. SSH public key generation
      • 1. Use the Git warehouse software to generate and view the SSH public key
      • 2. Generate and create an SSH public key
  • 3. SSH public key settings
  • Summarize

Foreword

Hi everyone, we meet again. I am the dog of Yelan. This article is the second article of the column [Git];
This is what I learned about Gitee today, start a new journey, record the best moments, and make a little progress every day.
Column address: [Git], this column is my summary of the process of using Git, Gitee and other tools. I hope to deepen my impression and help other friends
If there is anything that needs to be improved in the article, please feel free to enlighten me

1. Use of Gitee

For code warehouses, GitHub and Gitlab are well-known abroad (I also use this in my company), while there is code cloud (Gitee) in China, sometimes connected to GitHub can’t even be used for half a day, so I plan to save some small projects I have played on Gitee first. Without further ado, let’s take a look at how Gitee is used.

1. Log in to Gitee official website

First you need to log in to the Gitee website to use the Gitee warehouse management. No user can register one. This process is still very simple, Gitee official website.

2. Create warehouse

After successfully logging in to the Gitee website, let’s create a simple warehouse to store the code that needs to be uploaded. Click the + sign in the upper right corner –> Create a new warehouse.

Fill in the basic information of the warehouse-name and description, pay attention to the private warehouse created here at the beginning, if you want to make the warehouse public, you need to modify it to warehouse settings after creating the warehouse public.

3. Initialize the readme file

After creating the warehouse, the official strongly recommends that all git warehouses have a README , LICENSE , .gitignore file. Then click Initialize readme file to enter the interface for initializing the warehouse.

Note: After clicking Initialize readme file, the simple command line introductory tutorial will disappear, but don’t panic, here it is reserved in advance:< /strong>

Git global settings:

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

Create a git repository:

mkdir uni-shop2
cd uni-shop2
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/JMFive/uni-shop2.git
git push -u origin "master"

Already have a warehouse?

cd existing_git_repo
git remote add origin https://gitee.com/JMFive/uni-shop2.git
git push -u origin "master"

4. The warehouse is created

The creation of the warehouse is basically completed here.

The warehouse created earlier is private. If you want to make it public, you need to go to Management –> Basic Information –> Open Source, and select the open source option.

2. SSH public key generation

1. Use the Git warehouse software to generate and view the SSH public key

First run Git , the first time you run Git you need to set user information.

The following is the global configuration of Git username and email.

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

After the configuration is complete, you can check the configuration information, verify whether the configuration is successful, and enter the command

 git config --list

2. Generate and create SSH public key

Before generating the SSH public key, you must pay attention to whether it has been created before. You can pass the path C:\Users\JMFive\.ssh, where my computer user name is JMFive code>, as the case may be. If there are id_rsa and id_rsa.pub in the file, delete them and then enter the command to create a public key, otherwise unnecessary errors will occur.

After deleting the file, the SSH public key can be generated: input

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

Note: The mailbox here must be specified! ! ! It’s a trick, I’ve been cheated for a day here, because I configured the gitlab mailbox globally here, so the mailbox specified here.
If you don’t want to use the default file name, you can enter the file name, then enter the password and confirm the password again, otherwise press Enter three times in a row to use the default name and no password.
, At this point, the SSH public key will be automatically generated.

Creation methods that are prone to errors (not recommended):

Once the ssh created in this way is quoted, it will report the problem that the private key permission is too open.

Specify how the mailbox is created (recommended):

After generating the SSH public key, enter the cat command to view

cat ~/.ssh/id_rsa.pub

3. SSH public key settings

After the pre-work is done, the next step is to configure the SSH public key on Gitee and enter the setting interface.

Enter the SSH public key settings, where you can see the current SSH public key number and other information. Copy the public key you just checked into the SSH public key setting on the Gitee webpage, and add it.

After the addition is successful, you can see the public key information, and the entire configuration process is completed here.

Summary

Thank you for watching, here is the introduction and use of Gitee warehouse creation & amp; SSH public key generation, if you find it helpful, please give the article a like, so that more people can see it.

You are also welcome to follow me.

It’s not easy to be original, and I hope you guys will support me. Your likes, collections and comments are really important to me! ! ! Finally, there are still many shortcomings in this article. Friends who have read the article carefully are welcome to communicate, criticize and correct by private message at any time! See you next time.

More column subscriptions:

  • 【LeetCode solution (continuously updated)】
  • 【Java Web project construction process】
  • 【WeChat Mini Program Development Tutorial】
  • ? 【JavaScript Handy Notes】
  • 【Big Data Study Notes (Huawei Cloud)】
  • [Program error solution (recommended collection)]
  • 【Software Installation Tutorial】

Subscribe more, you will see more high-quality content! !

syntaxbug.com © 2021 All Rights Reserved.