- Download git client: Link: http://pan.baidu.com/s/1jIueUEy password: 7GEF;
- Download Eclipse Java EE client: HTTP://WWW.ECLIPSE.ORG/DOWNLOADS/PACKAGES/ECLIPSE-IDE-JAVA-EE-DEVELOPERS/KEPLERSR2;
- Go to GitHub to register, get to User.Name and User.email, that is, the corresponding user name and registered mailbox;
- New Warehouse (Repository), assuming the name is IRepository, then the warehouse URL is https://github.com/username/iRepository
- Open git client: (all starts with $, is the operation command on the GIT client)
- $ git config--global user.name "username"//here fill in User name
- $ git config--global user.email "useremail"//fill in the email here
- $ git config--global color.ui Auto//format
- $ ssh-keygen-t RSA//Generate Ssh-key, a blank space, will be generated in the GIT client installation directory. SSH folder, copy the contents of this folder named Id_rsa.pub
- Open the GitHub page-->settings-->ssh and GPG keys-->new SSH Key, add the Sshkey name and copy and paste the contents of the. Ssh/id_rsa.pub:
- $ git clone [email protected]:username/irepository.git//clone the repository to a local, clone followed by the repository link, which is obtained in such a way as:
- Open Eclipse, create a new Java project, and put the project in the local Git repository folder
- $ git status//view warehouse status, which lists different files from the remote repository
- Select the file that needs to be uploaded (because it's the first time, so it's all new) to the remote repository, for example, a new file called helloworld.jsp, then:$ git add helloworld.jsp
- $ git commit-m "add a JSP file: helloworld.jsp"//Submit to cache
- $ git push//submit to remote repository
- Since then, can be on different computers on the same project remote synchronization development, if you change the computer, repeat the above steps, the generation of SSH key can be cloned warehouse to the local
- Open eclipse--> Right-click-->import--> Search: git-->projects from git-->existing local repository--> add native git directory-- > select the warehouse-->next to import ...
- Continue to develop ...
- Go to the GIT client and repeat add, commit, and push operations
- Complete...
Java EE Development steps using GitHub and Eclipse