1. First log in to the CentOS server. After connecting to the server, we use the yum remove git command to delete the installed Git.
2. If you have not installed Git, ignore the previous step and use yum install git or yum insall -y git. Add a -y during the subsequent installation process. It's all automatic, there won't be any prompts for confirmation.
(Recommended tutorial: centos usage tutorial)
3. After the installation is complete, use the git --version command to view Git version, we can see the following version information, indicating that Git is installed successfully.
4. On CentOS, we use Git to connect to Gitee code cloud. First, we need to generate a public key on the server and enter ssh-keygen -t rsa -C on the command line. "xxxxx@xxxxx.com".
5. Use the command cat ~/.ssh/id_rsa.pub to view the content of the public key, copy it, and paste it into the place where the public key is added to Code Cloud. After pasting Click the "OK" button, and a pop-up box will appear. You need to enter the password of the code cloud. After entering, it will prompt that the SSH public key has been added successfully.
6. Next, return to the CentOS server and enter ssh -T git@gitee.com. If success is returned, the configuration is successful.
Related video tutorial recommendations: linux video tutorial
The above is the detailed content of An error occurred when setting up the basic software repository when installing centos system. For more information, please follow other related articles on the PHP Chinese website!