Uploading code to github can be done in the form of command line and client. The principle is the same.
Step 1: Create a git repository
cd to your local project root directory and execute the git command
git init
Step 2: Add all files of the project to the repository
git add .
If you want to add a specific file, just replace . with a specific file name
Step 3: Commit the add file to the repository
git commit -m "comment statement"
Step 4: Go to github to create your own Repository, and create a page as shown below:
Click on Create repository below, you will enter a page similar to the following, and get the https address of the created repository. The red box indicates the
Step 5: The point is here, associate the local repository to github
git remote add origin https://github.com/hanhailong/CustomRatingBar
Replace the following https link address with your own warehouse url address, which is the address marked in the red box above
Step 6: Before uploading to github, pull it first and execute the following command:
git pull origin master
After hitting enter, the output will be similar to the following
The seventh step, which is the last step, upload the code to the github remote repository
git push -u origin master
After the execution, if there is no exception, the upload will be successful after the execution is completed. You may be asked to enter the Username and Password in the middle. You only need to enter the github account and password.