1. Build the warehouse on the code hosting platform first
2. Create an SSH key locally
Ssh-keygen-t rsa-c "Hll19950830nomail@code.csdn.net"
3. Add the locally generated SSH key in the SSH public Key management of the code hosting platform
4. Global Settings username and email
$ git config--global user.name "hll19950830"
$ git config--global user.email "hll19950830nomail@code.scdn.net"
5. Enter the local project folder to create the README.MD
Touch readme.md
6. Go to the Local project folder to initialize the local project
Git init
7. Select Upload Current Folder
git Add.
8. Determine the submission
Git commit-m "Add EmpManage1.0"
9. Connect to the remote Git repository (git@code.csdn.net:hll19950830/empmanage1-0.git is the Remote repository address)
Git remote add Origin git@code.csdn.net:hll19950830/empmanage1-0.git
Git push Origin Master
If you execute git remote add Origin git@code.csdn.net:hll19950830/empmanage1-0.git,
Error occurred:
Fatal:remote origin already exists,
The following statement is executed:
Git remote RM origin
Then execute git remote add Origin git@code.csdn.net:hll19950830/empmanage1-0.git
When you execute GIT push Origin master,
Error:
error:failed to-push som refs to ....
The following statement is executed:
Git pull Origin Master
First, the remote server github above the file pulled first, and then push up.
Or use the Git Pull--rebase Origin master command to merge Code "note: Pull=fetch+merge"
Execute the statement again GIT push Origin master