git and IntelliJ idea Integrated learning notes

Source: Internet
Author: User
Tags commit git clone

Git learning notes integrated with IntelliJ idea. Git learning notes (based on GitHub) 1. Install and configure git download address: http://git-scm.com/downloads git brief instructions: http://rogerdudl er.github.io/git-guide/index.zh.html GitHub Official instructions for use: https://help.github.com/articles/set-up-git default installation configuration 1) First you have to tell Git that you   The name of git config--global user.name "Your name Here" 2) associated email address: git config--global user.email "your_email@example.com" The associated email address is best consistent with GitHub, if the inconsistency points here: https://help.github.com/articles/how-do-i-change-my-primary-email-address   2. Create a warehouse 1) create a warehouse on GitHub (registration omitted) 2) fill in the information of the warehouse; Example: Hello-world Congratulations! You have successfully created your first warehouse.     3. Create a readme for the warehouse. The readme is not a necessary part of GitHub, but he is a very good idea to describe your project or some documentation, such as how to install or use your project.     $mkdir ~/hello-world # Create a Hello-world folder in your directory   $CD ~/hello-world #  Change the current working directory to your newly created directory   $git Init # Initialize/users/you/hello-world/.git/  $touch readme #在你的hello World Directory to create a file called "README" in the C-drive user directory to enter hell O-world, open the Readme, fill in the things you want to fill   4. Submit your "Readme"   $git Add Readme # to add the ReadmeOn-hand list   $git commit-m ' first commit ' #  submit your file, add the message "Initial commit"   5. Push your submission to the GitHub Server $git remote add ori Gin Https://github.com/username/Hello-World.git # Create a remote named "origin" pointing to your GitHub library; Username: for your github username Hello-world This is case sensitive, it is important to keep the same server $git push Origin master #发送你的提交的 "master" branch to GitHub this time you will be asked to enter your username and password   ok! You can see the readme you submitted on the Hello-world on the server.     6. Create a branch at some point you may find yourself looking for someone else's project, or want to use someone else's project as a starting point. This is called a "branch". For this tutorial, we will use the  spoon-knife project, hosted on Github.com.      1) Create the "Spoon-knife" branch to create the branch project, click the "Fork" button in the GitHub library.   2) Clone branch You have successfully branched out " spoon-knife", but so far it only exists on GitHub. To be able to work on this project, you will need to clone it to your local machine.   $git clone https://github.com/username/Spoon-Knife.git #克隆你的分支的仓库到当前目录 3) Configure remote when a repository is cloned, it has a default remote known as the origin point pointing to your fork On GitHub, not the original warehouse is the branch that tracks the original warehouse, you need to add another remote named upstream   $CD Spoon-knife # change Active Directory, go to "spoon-knife" directory $git remote Add u Pstream Https://github.com/octocat/Spoon-Knife.git # Assign original library remote name to "upstream" $git fetch upstream # pulls in changes No T preSent in your local repository, without modifying your files     two. Share and get GitHub projects using IntelliJ idea: •   1. In idea, configure the Git: select Menu "File-settings" to find "Version control-git": The location of the Git.exe execution file in the installation directory of Git ·   Second, configure your account on GitHub: Fill in your GitHub account information, click the "Test" button to test the connection, if the link succeeds, it will prompt "Connection successful".   Save complete.    Click OK, at this point you may want to enter the IntelliJ idea password, if not set, click OK.   2. Sharing project on GitHub: Select Menu "Vcs-import into Version control-share project on Github":   After filling in the description, click "Share" button.   3. Get Github Project: Select Menu "Vcs-checkout from Version Control-github":   Wait a while for verification and login, interface: in "Git Repo Sitory URL "down list of both your own projects, as well as your on the GitHub site" WACTH "project, select, select the path you stored, then enter the name of the project you want, click the" Clone "button, that is, complete the acquisition process.

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.