How To: GitHub projects in Spring Tool Suite
The first step is sign up in the GitHub and create a new project. For example I’ve created a new project Spring3part7 in the GitHub. Before add the projects you need to configure STS for GitHub access. For example, you need to add configuration as shown in the following picture
Git local repository also important
Now you are ready to pull the project from the GitHub, in the STS import menu select the following
Now type the project name and click the ‘Search’ as shown in the following. However, when you select the found project click ‘Finish’ nothing will change in the STS interface.
Now you are going to create real project. Here I am going to create simple utility project.
This template project need to be created inside the imported GitHub project
You have to give the same project name of the GitHub project as shown in the following project
Now your project is ready to push. Before that you need to add ignore flag to all the folders and files except pom.xm , src and test.
Navigator view is the easiest for me
Now you can ‘commit’ as shown in the following
For this initial commit you can click the ‘Commit and Push’. In the following screen press ‘OK’ to push.
Instead of creating new project directly in the repo, how to share the existing project ? Here are the steps,
- I already have a Spring3Part13 project in my STS workspace.
- I’ve already created the GitHub repository and imported as explained in the beginning of this post. For example https://github.com/ojitha/Spring3Part13.git
- As shown in the following project, right click and select Team > Share Project… from the popup menu.
- Then select the “Git” from the Share Project.
- From the “Configure Git Repository” select the correct repository for your project which is already imported in the step 2.
- At last click “Finish”.
Figure for step 3
Figure for step 4
Figure for Step 5.
Now you are ready for your journey.
Comments
Post a Comment
commented your blog