I recently read an article about uploading projects from idea to GitHub, recorded it and used it as a reference:
Original address: https://www.cnblogs.com/jinjiyese153/p/6796668.html
1. Create an account in github: https://github.com/join?source=header-home
2. Download and install git: https://git-scm.com/downloads
3. After the installation is successful, open Git Bash and enter the following commands to set the git global username and email address
4. Set Git in IDEA, select the git.exe file after your git installation in File-->Setting->Version Control-->Git-->Path to Git executable, and then click Test to test whether the setting is successful
5. Set GitHub in IDEA, File-->Setting->Version Control-->GibHub
Host:github.com
Token: Click Create API Token, enter the username and password registered in github to generate a token
Click Test to test whether the connection is successful
6. Create a local repository, VCS-->Import into Version Control-->Create Git Repository...
Select the location of the project in the pop-up box, click OK, and all the project files will turn red (if other locations are selected, git-->add cannot be clicked, I don't know why)
7. Upload the project to the local warehouse, right-click the project and select Git-->add, the project file turns green at this time, and the file is only in the temporary storage area, and does not really enter the version library
Right-click on the project Git--> Commit Directory, enter Commit Message in the pop-up window, and click commit. At this time, the project file enters the repository from the temporary storage area, and the project file turns white.
8. Upload the project to GitHub, VCS-->Import into Version Control-->Share Project on GitHub, enter the warehouse name and description in the pop-up box, click Share to upload, and enter the GitHub username and password in the pop-up window. (The user name and password that have been entered and remembered will not be entered again in the pop-up box), after the upload is successful, a prompt will be given in the lower right corner of IDEA
9. Submit the modified file to GitHub
Add a new file (red), right-click -->Git-->add, add the new file to the local warehouse, and the file will turn green
Modify the file (blue)
Right-click on the project-->Git-->Commit Directory, view the changed files and enter Commit Message, click Commit and Push...
After submitting, the syntax check will be performed. If there are errors or warnings, a confirmation prompt will be given. Click Commit, the Push box will pop up, click Push, and the upload to GitHub is successful.
refer to:
http://blog.csdn.net/zongzhankui/article/details/46341967