1. Configure git and github warehouse
sudo apt-get install git
2. Configure the ssh key (after the interface appears, enter the relevant path and set the password)
ssh-keygen -t rsa -C "注册github的邮箱"
3. A .ssh file will appear in the home directory, enter the folder, open the id_rsa.pub file, and copy the contents inside.
4. Open your own github, click the avatar –> setting –> SSH and GPG keys –> new SSH key
5. Paste the content you just copied and save
6. Try to connect to github. (Enter yes)
ssh -T [email protected]
7. Configure your own github username and email
git config --global user.name "用户名"
git config --global user.email 邮箱
8. Enter the file directory you want to upload and initialize the warehouse
git init
9. Create a new warehouse in github and add remote access
Copy the ssh link and enter the following command
git remote add origin [email protected]*******
git remote set-url origin [email protected]:*************
10. Use the command to submit the file to the temporary fetch area
git add 文件名
Note: To upload that file or folder, just enter the name of that file or folder
Or enter the following command to upload all
git add .
11. Submit all these files to the local warehouse
git commit -m "init"
12. Add and upload the content of the local warehouse to github, and create a remote warehouse by yourself
git push -u origin master
13. After the upload is complete, refresh the github page to check whether it is uploaded