1. (Enter the project folder first) Turn this directory into a repository that git can manage by commanding git init
git init
2. Add the file to the repository, use the command git add . to add it to the staging area, don't forget the decimal point "." after it, which means to add all files in the folder
git add .
3. Use the command git commit to tell Git to submit the file to the repository. Commit instructions are in quotation marks
git commit -m 'first commit'
4. Associate to the remote library
git remote add origin your remote library address
Such as:
git remote add origin https://github.com/xxxx/xxxxxxxx.git/
5. Get the remote library and merge it with the local synchronization (if the remote library is not empty, this step must be done, otherwise the subsequent submission will fail)
git pull --rebase origin master
6. Push the contents of the local library to the remote, use the git push command, which actually pushes the current branch master to the remote. After executing this command, you will be asked to enter the user name and password. After the verification is passed, the upload will start.
git push -u origin master
*, status query command
git status
Remark:
For details, please refer to http://www.cnblogs.com/tugenhua0707/p/4050072.html