linux upload GitHub

Today I wrote a Python basic code and uploaded it to github via Linux. I encountered some problems and have been resolved.

1. First sudo su to enter the root user

2.ls check out what files are under the current file

3. cd into the folder you will upload

4. git init (I want to create a new git repository on this machine)

5.git add -A (here -A refers to adding all files of the target file to git, if you don't need to add all files, you can replace -A with a specific file name)

6. git commit -m "firstCommit" ("firstCommit" can also be changed to other descriptive text, which will eventually be displayed behind the file name on the github interface)

7.git remote add origin xxxxxxxxx xxxxxx is the address of your warehouse (used when creating a warehouse for the first time, this step is not required when uploading files next time, otherwise it will show that you already have a remote warehouse)

When uploading the code for the first time, the following situation occurred:
Please tell me who you are.
Run
git config --global user.email “[email protected]
git config --global user.name “Your Name”
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got'crystal@crystal-Inspiron-5425.(none)')
here is for you to enter the global project user.email and user.name. Of course, each project can also set partial user.email and user.name. Due to preliminary use, enter the following command according to the prompt
git config --global user.email “*****@ gmail.com"
git config --global user.name "crystal"
8. git push origin master>> If you use (git push -u origin master) for the first time to merge the local repo with the remote origin repo, first Once you use -u, the system asks to enter the account password and
Username for'https://github.com' will appear :
Password for'https://[email protected]':
Follow the prompt to enter the github account password
9. Log in to your github to view
10. Reprinted at: https://www.cnblogs.com/cswzp/ p/9982974.html

Guess you like

Origin blog.csdn.net/weixin_52270223/article/details/113938191