# Link Spring Boot Project to GitHub Repository

Below is a guide to link your Spring Boot Project to the GitHub repository. If you want to create a Spring Application, refer to this blog.

## **Step-By-Step Guide to Link Spring Boot to GitHub Repository.**

Create a **new GitHub repository** on GitHub:

![new-github-repository](https://lh7-rt.googleusercontent.com/docsz/AD_4nXczulNAhOgVtuKXMHvKXo5rLJDURaoJPwuxHRRWyiEslekG72LfELkJ9atXaUtD4NW9f_XgcbthA23gFOIOEZGuRiJ19lCg01Wqg9bf6j1-xlFmTnUQ9P4hLfUYTIW1uk6dhXO1hE9in6KZoK6-quC0NdUg7ovIeKGOBb4POMVOcIxuxdScA44?key=KFeyerzqpmqqZKrpVDG0eg align="left")

Let’s suppose we are creating an eCommerce website.

* Click on the **“Create repository”** button.
    
* On the next page, copy the following command:
    

`git remote add origin` [`https://github.com/Siddpawar9222/ecommerce-website.git`](https://github.com/Siddpawar9222/ecommerce-website.git)

![add-gitHub-repository](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe9P_wmjsXiRtAbqc5qTw0nZQ0wnG46SGuDGDZ-ACz-AU0d-lAvIroiy_Z-jcn5ikJhLrW1mTvYt-0NKUUGtXxAwqQFeZoZ5VIFZWbAHRIQ0bj5-fADPoX0JV_EEK162bW4oofrVJgBQhKF3mJaMoLse03g_tzUVLrV4mCe2GeggFjBG0LBuvk?key=KFeyerzqpmqqZKrpVDG0eg align="left")

Let’s suppose you created a new Spring Boot project named `ecommerce-website`.Open this project and open Git Bash or CND in this directory.

![ecommerce-website-directory](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe4JZushKoIExP1qivwVQVtZ4e1RdOZ__ZoOoFYAxpjcwB6wUkn4GvK-A4RZAjEpZFpYEa_svs2vbJqZJ623bxDEbXo2-JdaB30dCB9_kr0XrckrdkDTHS8oOdrKvAOhJADtZ-dZ7ZxObfsvUwnY3Wv6a_hVuHezjnETlFZOkbVzkbn_OuRN6c?key=PNKkVIql5HFCIiI9Xcyj8g align="left")

![gitbash-ecommerce-website-directory](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcBfjX-CCsRyJu5T2bx9LsfiYdVQnJkWNlswW5UdRZj6VQBNovC3uesYdBHDwgtFGtggQUvnh2XegldaqreRiYuSAldhWR7B44LaIQPvFl-RJgRLyzLgVm45hicDqCWBrKEahyGLHesjSlmllU7tVcVJ_wVu8TkjdBc_eVc8ujWnL0Ov_ezg2Y?key=PNKkVIql5HFCIiI9Xcyj8g align="left")

**Initialize the Git directory** using the command: `git init`

![initialize-git-directory](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfVuXbU5DEdIl9XeFA6QcuD-yoURxSaQdMpiHI8kRMVGtTGHLUmuKuteYRheomkkwtCdN4LIgXUazdtjyGVaJ11_LjvE8Tmx7pYoA5Oog_cjnpl-qbeYFV39Ca2avz8H1VQlrnk_C2_2JgnX1Nz4XtkLu9KF1ivCU3zJDOTjPoiaWe9t19CLQ?key=KFeyerzqpmqqZKrpVDG0eg align="left")

**Stage and commit changes** using the command:

`git add . git commit -m "created ecommerce website project"`

![stage-commit-changes](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdpzh4b3Ti3ZGR0J2IdlQo-4rivxJd5lm5haNzQo4G6sSJi39snYYcI436SGbxd75XLFOoqXXLRNkH-aT7xy49BJK6aZpFoh9VM5WS7YputM7mnTT2lpr7P6Uklhb3FN0lDmuQg8SqZKFzM27ts7yPpbkmh8jT-IZhxVJLtvmE6T0RsAaZldOU?key=KFeyerzqpmqqZKrpVDG0eg align="left")

**Add the GitHub repository** by pasting and executing the command we copied in Step 1:

`git remote add origin` [`https://github.com/Siddpawar9222/ecommerce-website.git`](https://github.com/Siddpawar9222/ecommerce-website.git)

![add-git-repo-github](https://lh7-rt.googleusercontent.com/docsz/AD_4nXceQoYVVkTKyQL5ee1ThDiFZOU74xfCNz-Y8tYQFhxFsyRzzgqe8Ry0lHEJ3S2YbNIfNn_NiPhhIdhy842zHT5vxIMj9kpzVMdLLOKTVecltI3rvyLODWOC74Hba9NmDbS-nYJYtMIuTccZygAMIrXv4jjqbS3LWPdvEkt2MZLZU517gYKhaSg?key=KFeyerzqpmqqZKrpVDG0eg align="left")

**Push changes to GitHub** using the command: `git push origin master`

![push-changes-github](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcXlgKKZM_WonvGWkXWsXoinWDMJ9xPAGODX5DVuAd3rPIyPehh0DTGzdPO8zWi8ZFLEMMgqiPpSHNS4wZWWFMnOO6q1drAJEuXsy0PEha4je4al36WwBYT2iTsuts2MuN-I96TR0KTG_eGBYNvo8ZND6gko9VKI-6pNYM-tHG5NAS_FE7Poxw?key=KFeyerzqpmqqZKrpVDG0eg align="left")

On the GitHub repository, you can see that we have connected the local Git repo to the GitHub repository. The master branch is also created, and all changes are pushed to GitHub.

![master-branch-created](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc83TVMm7bcrCXj4nz_nN_9VMH69sp9q3T_0Ncfm-HR15oSkivsaiRlgo5NQ-UErsLIk1ev5g5L-bZ4bhItZn0zid7_raMyUl9N2-CJxGqJcVfk-SLspL0ULI4UdYZuCmG7e6YkcvgMYDuUCjV-oP13TtpY3YiYhqjJcRaYMLel9OeHUUlddQM?key=KFeyerzqpmqqZKrpVDG0eg align="left")

Congratulations! You have successfully created a Spring Boot Application and linked it to GitHub.

***Watch our YouTube Video to work with GitHub and learn the PR process.***

%[https://www.youtube.com/watch?v=yxTQUS1kOGA&t=813s]
