Previously used GitHub to manage their own code, but has been unable to remember the statement, today again use GitHub, or record it.
1. Upload your own code for the first time
Create your own library on the GitHub and execute it in the directory of your code:
Git init
Touch readme.md
git add readme.md
When git commit-m ' first_commit ' executes this sentence, sometimes it goes wrong.
When this error occurs, follow the prompts: git config--global user.email "you@example.com" Your git account's mailbox
git config--global user.name "Your name" the username of your git account
Git remote add Origin https://github.com/nicky-ji/Turbo.git
Git push Origin Master
2. Update your own code base
This is the method used to update the code base
git Add. (Note that there is a dot below.)
Git commit-m ' first_commit '
Git remote add Origin https://github.com/nicky-ji/Turbo.git
Execution may occur when the following appears, execute the statement git remote RM origin
Git push origin master enter username and password OK.
Ps:
In fact, when I first contacted GitHub, I didn't succeed with the first method above. Instead of cloning the empty code base,
Execute git clone https://github.com/nicky-ji/Turbo.git and execute the 2 statement first. Hey, also a way to wow