Submit the local java project to github and java project github.

Source: Internet
Author: User
Tags using git

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.

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.