Idea uses git to manage code, uploading code to github or the code cloud

Source: Internet
Author: User

1: Download git address: Https://git-scm.com/download/win

2: Start git bash enter the following command (green labeled: separator, not related command):

Git : See if the installation was successful

Ssh-keygen-t rsa-c "Your email address" : Configure the SSH key, the first step in the execution is to let you confirm whether to generate the secret key under the path, you can also write a new path, on duty directly enter the right, and then enter the password two times

git config--global user.name "your username": Configure the Global user name

git config--global user.email "Your mailbox : Configure a global mailbox

3: Create a project on GitHub or the code cloud, no more detailed instructions here

4:idea Configure git and build the project, where the project name is the same as the project name on GitHub or the code cloud

5: Execute the following command once in Git

Git init

git add src

Git commit-m "First commit"

Git remote add Origin https://github.com/mw138/TestGit.git (Https://github.com/mw138/TestGit.git for the address where you created the project on GitHub or the code cloud)

Git push-u Origin Master

If you do not have an error, enter your user name, password

The common mistake here is that the following error occurs when executing the GIT push-u Origin Master command, mainly because the readme.md file in GitHub is not in the local code directory

Execute the git Pull--rebase Origin master command to merge the code and then execute the GIT push-u Origin master command

6: At this point, idea will be able to submit the code.

To write a new Java file, right-click on git, click Add, then click on Commint Directory under Git, select what you want to submit, and in commit, select commit and push to commit.

  

Idea uses git to manage code, uploading code to github or the code cloud

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.