How to create step by step GitHub repository with SpringToolSuite

GitHub is a web-based service that uses the Git revision control system to manage sourcecodes.
In the tutorial, JavaSampleApproach will guide you through the steps of configuring GitHub repository with SpringToolSuite for development.

I. Techonologies

– GitHub
– SpringToolSuite

II. Practices

Step to do:
– Register GitHub account
– Create a GitHubRepository
– Configure GitHub for SpringToolSuite
– Create & Share a project to GitHub

1. Setup GitHub account

Go to https://github.com/, then SignUp:

register github

Press the button Sign up for GitHub, we go to next panel: Welcome to GitHub

register github - welcome to github board

Here having 2 options for choosing:
– Unlimited public repositories for free
– Unlimited private repositories ($7/month)

For starting, you should choose the first option.
Press Continue.

We go to next panel: Tailor your experience.

Tailor your experience

In here, you have some checkboxes to describes about you. Then press Submit.

Right now, a GitHub message will be sent to your mail account to verify the register.

github - verify email

Click to the link: Verify email address for done the registration.

2. Create a GitHub repository

Now go to Create a new repository page by following the link: github.com/new

Create a new repository

Fill info about: Repository name, Description (option).
We have 2 mode for choosing: Public & Private
– Public: Anyone can see this repository. You choose who can commit.
– Private: You choose who can see and commit to this repository. But having money for the mode ()

For starting, we choose Public mode.
Check a option: Initialize this repository with a README.

Create a new repository

Press Create repository button. JavaSampleApproach/tutorials is created successfully.

github - tutorials repository is created successfully

3. Configure GitHub for SpringToolSuite

Open SpringToolSuite, go to: Window-> Show view -> Others -> Git Repositories.

git hub - clone uri

Choose Clone URI. Then fill data: uriusername/password

Note: we got URI at the Clone or download button of the tutorial repository as below image:

git-uri

Press Next, go to Branch Selection, choose master,

STS git hub - choose brand

Press Next, go to Local Destination Configuration, edit Directory, then press Finish:

STS configure local destination

Now, We have finished the GitHub setup for SpringToolSuite.

sts - git repository

4. Create a project & Commit to GitHub
4.1 Create and Share project to GitHub

Create a simple SpringStartProject: GitHubHelloworld.
Right click on the project, go to Team->Share, fill needed info about GitHub repository:

STS - Team - Share project

Press Finish button, the result as below image:

Sts - Share 
Done

4.2 Commit Sourcecode

Go to the project’s folder, modify .gitignore file:

github - modified gitignore file

Replace the old content of .gitignore file with the new content:

Add to Index: right click on the project, go to Team -> Add to Index.

Commit: right click on the project, go to -> Commit

STS - Commit

STS-add to index then Commit

Press Commit & Push, then provides authentication info:

STS - Commit - press usr pass

The result after done:

STS-Gibhub-DoneCommit & Push

GitHub-First Commit STS project

Mistake - not deletesome file

Problems: we need deleted files: .mvn/wrapper and mvnw,
mvnw.cmd
.
=> How to do it?

Just open .gitignore file, change content of the file to:

Then delete the files from project: .mvn/wrapper/ & mvnw, mvnw.cmd. Righ click on the project, go to Team -> Add to Index.

Commit again:
Righ click on the project, go to Team -> Commit. Add comment:

Now press Commit & Push, see the results:

Github - STS - fix mistake - message

Github - STS - fix mistake

III. GitHub Repository Demo

JavaSampleApproach/tutorials


Related Posts


Got Something To Say:

Your email address will not be published. Required fields are marked *

*