1. Article reference from : http://my.oschina.net/lujianing/blog/180728
2. Setting up related bindings
Settings--version Control--git--path to Git executable--Select your installation directory
Settings--version Control--github This way Host:github.com Login: Account Password: Password
3. Local git commit for the project
IntelliJ has integrated GIT version control internally so it can be used directly locally
3.1 Creating a local warehouse
Select the project directory, click OK, Idea will build a git repository for the project, you can go to the project directory, see the. git folder, indicating that the establishment of the GIT repository is successful. But at the same time idea will prompt: The directory E:\Git\coding\learnTest is under Git, and is not registered in the Settings as shown below.
Just click Configure. Then select the green + sign in the upper right corner
You can register the warehouse in idea.
3.2 Commit code to local git
Right-click the project or file Git--add--commit (ADD before submitting)
4. Configure Remote Commit
Create a warehouse on 4.1 GitHub
Configuring remote repositories in 4.2 Git shell
If we haven't done anything for the first time, we want to submit it to the remote repository. The following error will appear
This time we need to build a branch and commit.
Problem solving method Reference from stackoverflow:http://stackoverflow.com/questions/12452042/ Git-error-src-refspec-master-does-not-match-any-error-failed-to-push-some-refs
Once again to the remote repository, the following problems may occur.
It seems like the problem is that there is a readme file in the project built by GitHub, and the project we built is not, and we can use Git to push-f Origin master, force the submission, and overwrite the project on GitHub. But only for the first time, if this is the case, it will overwrite the content on GitHub.
Problem solving method Reference from Stackoverflow:http://stackoverflow.com/questions/20939648/issue-pushing-new-code-in-github
"Go" Intellij idea submit code to remote GitHub repository