cat/etc/redhat-release Viewing system version information
"CentOS Linux release 7.4.1708 (Core)
Background: I have already registered a GitHub account, previously installed a GIT client under Windows system and uploaded a local project to GitHub, and now want to create a project on my own server and synchronize with GitHub remote repository. A similar one, remember again.
one, git terminal software installation
- install git under root User: yum install git
Second, the configuration
- Generate secret Key
Use command: ssh-keygen-t rsa-c "[email protected]" To get the key (the mailbox here is the same as the GIT official online registration), enter the/root/.ssh directory, find a rsa.pub file, execute the command: VI id_ Rsa.pub, copy all of the contents.
- Browser into your github, open the settings, go to ssh and GPG keys3, click on new SSH key, fill in the title yourself, the following content to copy the previous open public key, and finally add the steps to read 4, you can use ssh-t [email Protected] Test Whether you can connect successfully, the middle of a input need to enter Yes, you can see Hi XXXX .... Access indicates success. 5, after the successful connection, you need to set up user information
git config--global user.name ' username ' #设置用户名
git config--global user.email "Youremail" #设置邮箱
Third, upload the project
Next you can create a new repository on GitHub and then submit a local project under Linux to GitHub.
Install git and upload code under Linux (CentOS)