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

image

Git local repository also important

image

Now you are ready to pull the project from the GitHub, in the STS import menu select the following

image

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.

image

Now you are going to create real project. Here I am going to create simple utility project.

image

This template project need to be created inside the imported GitHub project

image

You have to give the same project name of the GitHub project as shown in the following project

image

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.

image

Navigator view is the easiest for me

image

Now you can ‘commit’ as shown in the following

image

For this initial commit you can click the ‘Commit and Push’. In the following screen press ‘OK’ to push.

image

Instead of creating new project directly in the repo, how to share the existing project ? Here are the steps,

  1. I already have a Spring3Part13 project in my STS workspace.
  2. 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
  3. As shown in the following project, right click and select Team > Share Project… from the popup menu.
  4. Then select the “Git” from the Share Project.
  5. From the “Configure Git Repository” select the correct repository for your project which is already imported in the step 2.
  6. At last click “Finish”.

 

image

Figure for step 3

 

image

Figure for step 4

image

Figure for Step 5.

Now you are ready for your journey.

Comments

Popular posts from this blog

Spring 3 Part 7: Spring with Databases

Parse the namespace based XML using Python