1. After we have created a new Java project, we need to submit it to GitHub for version control
2. If the warehouse in GitHub is not empty at this time, we will report the following error when we use GIT push submission locally.
! [Rejected] master, master (Non-fast-forward)
Cause: A file that does not exist in the local project already exists in the GitHub repository, and a flush map has occurred
Workaround: First pull down all the files in the GitHub repository, as this is the 2 unrelated repositories, the direct git pull will error:
Fatal:refusing to merge unrelated histories
Workaround: Add--allow-unrelated-histories after the pull instruction, which is the final command: Git pull--allow-unrelated-histories
After 3.pull, the push can be used again to successfully commit to the remote repository
Submit a local Java project to GitHub