Before using GitHub to manage their own code, but have been unable to remember the statement, today and use GitHub, or record it!
1. Upload your own code for the first time
Create your own library on GitHub and execute it in the directory of your code:
Git init
Touch readme.md
git add readme.md
Git commit-m ' first_commit ' sometimes makes mistakes when executing this sentence.
When this error occurs, follow the prompts: git config--global user.email "[email protected]" Your git account's mailbox
git config--global user.name "Your name" username for 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 for updating the code base
git Add. (Note that there is a dot behind it.)
Git commit-m ' first_commit '
Git remote add Origin https://github.com/nicky-ji/Turbo.git
Execution may occur when the following appears, execute statement git remote RM origin
Git push origin Master Enter user name and password OK!
Ps:
In fact, when I first approached GitHub, I didn't succeed with the first method above. Instead of cloning the empty code base first,
Execute the git clone https://github.com/nicky-ji/Turbo.git and execute the 2 statement first. Hey, it's also a way to wow
GitHub Uploading files