Submit the local java project to github and java project github.
1. After creating a java project, submit it to github for version control.
2. If the repository in github is not empty at this time, the following error will be reported during local commit using git push,
! [Rejected] master-> master (non-fast-forward)
Cause: the github repository contains files that do not exist in the local project.
Solution: first put all the files in the github repository pull down. At this time, because this is two irrelevant repositories, directly using git pull will report an error:
Fatal: refusing to merge unrelated histories
Solution: add the -- allow-unrelated-histories command after the pull command, that is, the final command is: git pull -- allow-unrelated-histories
3. After pull is enabled, you can use push again to submit it to the remote warehouse.