Article Directory
1 Introduction
Use GitHub as a project hosting website. If the internet speed is not good, it will affect efficiency. You can also use the domestic project hosting website-Code Cloud. The website is https://gitee.com/ , the usage is the same as GitHub, and it is also a Chinese website, if your English is not very good, it is the best choice.
2. Configure SSH password-free login
Uploading projects through HTTPS mode on Code Cloud is the same as on GitHub, but uploading projects on Code Cloud always enter the user name and password, which is more troublesome, so I will show you how to upload projects through SSH mode without password login and use SSH mode. The advantage is that you do not need to enter a user name and password each time you upload a project, and SSH password-free login is also applicable to GitHub.
The premise of using SSH mode is that you must be the owner or collaborator of this project and have an SSH Key.
The steps to configure SSH Key are as follows:
-
Enter the user directory of the computer, right-click the user directory to open the Git command line window
-
Create an SSH Key and
enter the following command in the command line window
ssh-keygen -t rsa -C 任意内容
Command Parameters Description:
-t = of The Key to Generate The type of
type of key
-C = comment to identify the key
annotation for identifying the key
Enter the command and press Enter, and then press Enter, Enter, and Enter
-
If the SSH Key is successfully created, a .ssh folder will be generated in the user directory
-
Go to the .ssh folder, view the id_rsa.pub file, and copy all the contents
-
Find the settings of the code cloud account
-
Click the SSH public key, set the title, paste the public key, and click OK
Tips: Multiple SSH public keys can be added to the code cloud account, but a computer can only authorize one user to log in without password
7) Copy the SSH address of the warehouse in the code cloud account
3. Upload the project through SSH mode in Eclipse
After the SSH Key is created, Eclipse can automatically identify the corresponding public key and private key files
Steps to upload project via SSH mode:
-
Right click on the project to upload
-
Click New Remote...
-
Copy the address in SSH mode and give the remote address an alias
-
Because it is the first time to use SSH mode, after clicking Finish, you need to check the save key, and check to create the known_hosts file. This is not necessary in the future
-
Click Preview to enter the confirmation upload window
-
Click Push to start uploading, no longer need to enter username and password
-
Uploaded successfully
4. Upload the project through SSH mode in Idea
-
Create a new warehouse in the code cloud account and copy the address in SSH mode
-
Right click on the project to be uploaded in Idea
-
Click origin→Define Remote in the pop-up window
-
Set SSH mode remote address and alias
-
Select the defined sshorigin to start uploading the project
-
Click Push to upload directly