"Go" Intellij idea submit code to remote GitHub repository

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.